rbevans

PCRename

Oct 9th, 2012
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Generated Form Function
  2. function GenerateForm {
  3. Import-Module ActiveDirectory
  4. #login
  5. $credential = Get-Credential
  6. ########################################################################
  7. # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0
  8. # Generated On: 10/5/2012 12:11 PM
  9. # Generated By: rbevans
  10. ########################################################################
  11.  
  12. #region Import the Assemblies
  13. [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
  14. [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
  15. #endregion
  16.  
  17. #region Generated Form Objects
  18. $PCRename = New-Object System.Windows.Forms.Form
  19. $CompInfoTab = New-Object System.Windows.Forms.TabControl
  20. $StatusVersion = New-Object System.Windows.Forms.StatusBar
  21. $tabPage1 = New-Object System.Windows.Forms.TabPage
  22. $ViewCDriveBTN = New-Object System.Windows.Forms.Button
  23. $RDPBTN = New-Object System.Windows.Forms.Button
  24. $FindCompWarning = New-Object System.Windows.Forms.Label
  25. $ReportsGRP = New-Object System.Windows.Forms.GroupBox
  26. $RptWarning = New-Object System.Windows.Forms.Label
  27. $SoftwareBTN = New-Object System.Windows.Forms.Button
  28. $hotfix_reportBTN = New-Object System.Windows.Forms.Button
  29. $ExportcheckBox = New-Object System.Windows.Forms.CheckBox
  30. $FindCompBTN = New-Object System.Windows.Forms.Button
  31. $ComputerName = New-Object System.Windows.Forms.Label
  32. $CompNameTextBOX = New-Object System.Windows.Forms.TextBox
  33. $CompInfoGRP = New-Object System.Windows.Forms.GroupBox
  34. $SDIInfo = New-Object System.Windows.Forms.TextBox
  35. $LoginInfo = New-Object System.Windows.Forms.TextBox
  36. $IPInfo = New-Object System.Windows.Forms.TextBox
  37. $ImageLab = New-Object System.Windows.Forms.Label
  38. $QueryHelpLabel = New-Object System.Windows.Forms.Label
  39. $LoginLabel = New-Object System.Windows.Forms.Label
  40. $IPLabel = New-Object System.Windows.Forms.Label
  41. $tabPage2 = New-Object System.Windows.Forms.TabPage
  42. $QueryADBox = New-Object System.Windows.Forms.TextBox
  43. $QueryLabel = New-Object System.Windows.Forms.Label
  44. $QueryADBTN = New-Object System.Windows.Forms.Button
  45. $WarningLabel = New-Object System.Windows.Forms.Label
  46. $RenameCompBTN = New-Object System.Windows.Forms.Button
  47. $NewCompBox = New-Object System.Windows.Forms.TextBox
  48. $CUCompNameBox = New-Object System.Windows.Forms.TextBox
  49. $NewCompName = New-Object System.Windows.Forms.Label
  50. $OldCompName = New-Object System.Windows.Forms.Label
  51. $tabPage3 = New-Object System.Windows.Forms.TabPage
  52. $aboutbox = New-Object System.Windows.Forms.GroupBox
  53. $AboutLabel = New-Object System.Windows.Forms.TextBox
  54. $CUSGetInfoBTN = New-Object System.Windows.Forms.Button
  55. $CUSSoftwareBTN = New-Object System.Windows.Forms.Button
  56. $CUSModelOut = New-Object System.Windows.Forms.TextBox
  57. $CUSCompModel = New-Object System.Windows.Forms.Label
  58. $CUSSDIOut = New-Object System.Windows.Forms.TextBox
  59. $CUSSerialOut = New-Object System.Windows.Forms.TextBox
  60. $CUSNameout = New-Object System.Windows.Forms.TextBox
  61. $CUSIPOut = New-Object System.Windows.Forms.TextBox
  62. $CUSCompNameOut = New-Object System.Windows.Forms.TextBox
  63. $CUSSDILabel = New-Object System.Windows.Forms.Label
  64. $CUSCompSsLabel = New-Object System.Windows.Forms.Label
  65. $CUSCompIpLabel = New-Object System.Windows.Forms.Label
  66. $CUSCompNameLabel = New-Object System.Windows.Forms.Label
  67. $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
  68.  
  69. #endregion Generated Form Objects
  70.  
  71. #----------------------------------------------
  72. #Generated Event Script Blocks
  73. #----------------------------------------------
  74. #Provide Custom Code for events specified in PrimalForms.
  75. $handler_label3_Click=
  76. {
  77. #TODO: Place custom script here
  78.  
  79. }
  80.  
  81. $ViewCDriveBTN_OnClick=
  82. {
  83. explorer \\$current\C$
  84. }
  85.  
  86. $QueryADBTN_OnClick=
  87. {
  88. $a="$QueryADBox"
  89. $ADQ = $a.TrimStart("System.Windows.Forms.TextBox, Text:")
  90. $out="$ADQ*"
  91. write-host "query the ad - $out and $a"
  92. Get-ADComputer -Filter 'SamAccountName -like $out' | Export-Csv $env:userprofile\desktop\dsquery.csv
  93. ##Get-ADComputer -Filter 'SamAccountName -like $out' | ogv
  94.                     #Prompt that export to text file complete.
  95.                     [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
  96.                     [Windows.Forms.MessageBox]::Show(“Query complete.  See dsquery.csv saved to Desktop.”, “pcRenamifier v3.1”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
  97. }
  98.  
  99. $hotfix_reportBTN_OnClick=
  100. {
  101. if($ExportcheckBox.Checked -eq $True)
  102. {
  103. Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName $current -Authentication 6 -credential $credential | select description,hotfixid,installedon | Sort InstallDate -Descending | Export-Csv $env:userprofile\desktop\$current-Hotfixes.csv
  104.     [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
  105.     [Windows.Forms.MessageBox]::Show(“Hotfix/Updates report exported to Excel on desktop.”, “pcRenamifier v3.1”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
  106. }
  107. Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName $current -Authentication 6 -credential $credential | select description,hotfixid,installedon | Sort InstallDate -Descending | ogv
  108. }
  109.  
  110. $handler_form1_Load=
  111. {
  112. #TODO: Place custom script here
  113.  
  114. }
  115.  
  116. $handler_label4_Click=
  117. {
  118. #TODO: Place custom script here
  119.  
  120. }
  121.  
  122. $RenameCompBTN_OnClick=
  123. {
  124. ##Get Comp Old and New names
  125.     $a="$CUCompNameBox"
  126.     $current = $a.TrimStart("System.Windows.Forms.TextBox, Text:")
  127.     Write-Host "$current"
  128.         try
  129.         {
  130.         $findpc = Get-ADComputer $Current -properties CN
  131.         } #end try
  132.         catch [system.Exception]
  133.         {
  134.         write-warning "<< $old computer not found in AD. Please try again. >>"
  135.         [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  136.         [System.Windows.Forms.MessageBox]::Show("$current not found in Active Directory." , "Try Again", "0", "Warning")
  137.         } #end catch
  138.  
  139.     $b="$NewCompBox"
  140.     $new = $b.TrimStart("System.Windows.Forms.TextBox, Text:")
  141.     Write-Host "$current"
  142.         try
  143.         {
  144.         $findnpc = Get-ADComputer $new -properties CN #searching for duplicates
  145.             if($findpc -ne $null)
  146.             {
  147.             write-warning "<< $new - Duplicates      in Active Directory. Please try again. >>"
  148.             [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  149.             [System.Windows.Forms.MessageBox]::Show("$new - Duplicates not allowed in Active Directory. Please try again." , "Try Again", "0", "Warning")
  150.             }
  151.         } #end try
  152.         catch [system.Exception] #error catching
  153.         {
  154.         write-host "<< $new is a valid name. >>"
  155.         #computer rename process & prompt
  156.         [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  157.         $rename = [System.Windows.Forms.MessageBox]::Show("$CURRENT will be renamed to $new.  Is this correct?" , "Confirm", "1",  "Information")  
  158.         } #end catch
  159.         Finally
  160.             {
  161.             if ($rename -eq "OK")
  162.                 {
  163.                     try
  164.                     {
  165.                         #Computer rename
  166.                         $remotemachine = Get-WmiObject Win32_ComputerSystem -ComputerName $current -Authentication 6 -credential $credential
  167.                         $remotemachine.Rename($new,$credential.GetNetworkCredential().Password,$credential.Username)
  168.                     }
  169.                     catch [System.UnauthorizedAccessException]
  170.                     {
  171.                         [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  172.                         [System.Windows.Forms.MessageBox]::Show("Invalid A.ACCOUNT login.  Please try again. " , "Login", "0", "Warning")
  173.                         $credential = Get-Credential
  174.                     }
  175.                     try
  176.                     {
  177.                         $errorActionPreference = 'Stop'
  178.                         restart-computer $current -credential $credential
  179.                         [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  180.                         [System.Windows.Forms.MessageBox]::Show("$current has been renamed to $new and is rebooting.  Have a nice day." , "Reboot", "0", "Information")
  181.                     }
  182.                     catch [Exception]
  183.                     {
  184.                         [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  185.                         [System.Windows.Forms.MessageBox]::Show("There is currently a user logged on this computer and the computer will not be rebooted.  Please reboot manually." , "Reboot", "0", "Warning")
  186.                     }
  187.                 } #end if rename OK    
  188.             elseif ($rename -eq "Cancel")
  189.                 {
  190.                 [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  191.                 [System.Windows.Forms.MessageBox]::Show("Computer renamed cancelled." , "Cancel", "0", "Warning")
  192.                 } #end else if     
  193.             }
  194.     }
  195.  
  196. $CUSGetInfoBTN_OnClick=
  197. {
  198. #Get Computer name
  199. $CUSCompNameOut.Text = gc env:computername
  200. #get ip address
  201. $CUSIpOut.Text = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE | Select -ExpandProperty IPAddress
  202. #get computer image
  203. $CUSSDIOut.Text= get-wmiObject -Class Win32_OperatingSystem |Select -ExpandProperty Description
  204. #get computer model
  205. $CUSmodelOut.text = get-wmiobject -Class Win32_ComputerSystem | Select -ExpandProperty model
  206. #get computer serial number
  207. $CUSSerialOut.Text = Get-WmiObject Win32_bios | Select -ExpandProperty Serialnumber
  208. if ($CUSCompName -ne "Current Name")
  209. {
  210. $CUSSoftwareBTN.Enabled = $true
  211. }
  212. }
  213.  
  214. $CUSSoftwareBTN_OnClick=
  215. {
  216. gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString |ogv
  217. }
  218.  
  219. $FindCompBTN_OnClick=
  220. {
  221.         $a="$CompNameTextBox"
  222.         $current = $a.TrimStart("System.Windows.Forms.TextBox, Text:")
  223.         Write-Host "$current"
  224.     try
  225.     {
  226.         ##Get IP Address
  227.         $IPInfo.Text = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $current -Authentication 6 -credential $credential -filter "IpEnabled = TRUE" | Select -ExpandProperty IPAddress
  228.         Write-host "$IP"
  229.  
  230.         ##Get last login
  231.         $c = get-wmiObject -Class Win32_UserProfile -ComputerName $current -Authentication 6 -credential $credential | Sort-Object -Property LastUseTime -Descending | Select-Object -First 1 -expandproperty LocalPath
  232.         $LoginInfo.Text = $c.TrimStart("C:\Windows\ServiceProfiles\")
  233.         write-host "$c"
  234.  
  235.         ##Get Image
  236.         $SDIInfo.Text = get-wmiObject -Class Win32_OperatingSystem -ComputerName $current -Authentication 6 -credential $credential |Select -ExpandProperty Description
  237.     }
  238.     catch [system.Exception]
  239.     {
  240.     [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  241.     [System.Windows.Forms.MessageBox]::Show("Computer Name not valid or computer is turned off." , "$current", "0", "Warning")
  242.     }
  243.  
  244. #enables reports buttons
  245. if ($IPinfo -ne $null)
  246. {
  247. $SoftwareBTN.Enabled = $true
  248. $hotfix_reportBTN.Enabled = $true
  249. $ViewCDriveBTN.Enabled = $true
  250. }
  251. }
  252.  
  253. $handler_label1_Click=
  254. {
  255. #TODO: Place custom script here
  256.  
  257. }
  258.  
  259. $SoftwareBTN_OnClick=
  260. {
  261. if($ExportcheckBox.Checked -eq $True)
  262. {
  263. #export to csv file on desktop
  264. Get-WmiObject -class win32_product -ComputerName $current -Authentication 6 -credential $credential | Select Name,Version,PackageName,Installdate,Vendor | Sort InstallDate -Descending| Export-Csv $env:userprofile\desktop\$current-$Fdate-Software.csv
  265.     [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
  266.     [Windows.Forms.MessageBox]::Show(“Software report exported to Excel on desktop.”, “pcRenamifier v3.1”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
  267. }
  268. Get-WmiObject -class win32_product -ComputerName $current -Authentication 6 -credential $credential | Select Name,Version,PackageName,Installdate,Vendor | Sort InstallDate -Descending| ogv
  269. }
  270.  
  271. $handler_IPLabel_Click=
  272. {
  273. #TODO: Place custom script here
  274.  
  275. }
  276.  
  277. $RDPBTN_OnClick=
  278. {
  279. MSTSC.exe /v:$current
  280. }
  281.  
  282. $OnLoadForm_StateCorrection=
  283. {#Correct the initial state of the form to prevent the .Net maximized form issue
  284.     $PCRename.WindowState = $InitialFormWindowState
  285.     $update=Test-Path "\\Insert\path\here" #\\example\update.zip
  286.     if($update -eq "True")
  287.     {
  288.     $StatusVersion.Text = "New Update Available - 3.1!"
  289.     }
  290. }
  291.  
  292. #----------------------------------------------
  293. #region Generated Form Code
  294. $PCRename.AutoScaleMode = 0
  295. $PCRename.BackColor = [System.Drawing.Color]::FromArgb(255,240,240,240)
  296. $System_Drawing_Size = New-Object System.Drawing.Size
  297. $System_Drawing_Size.Height = 412
  298. $System_Drawing_Size.Width = 584
  299. $PCRename.ClientSize = $System_Drawing_Size
  300. $PCRename.DataBindings.DefaultDataSourceUpdateMode = 0
  301. $PCRename.HelpButton = $True
  302. $PCRename.MaximizeBox = $False
  303. $System_Drawing_Size = New-Object System.Drawing.Size
  304. $System_Drawing_Size.Height = 450
  305. $System_Drawing_Size.Width = 600
  306. $PCRename.MaximumSize = $System_Drawing_Size
  307. $PCRename.Name = "PCRename"
  308. $PCRename.SizeGripStyle = 2
  309. $PCRename.Text = "PCRenamifier v3.1"
  310. $PCRename.add_Load($handler_form1_Load)
  311.  
  312. $StatusVersion.DataBindings.DefaultDataSourceUpdateMode = 0
  313. $System_Drawing_Point = New-Object System.Drawing.Point
  314. $System_Drawing_Point.X = 0
  315. $System_Drawing_Point.Y = 390
  316. $StatusVersion.Location = $System_Drawing_Point
  317. $StatusVersion.Name = "StatusVersion"
  318. $System_Drawing_Size = New-Object System.Drawing.Size
  319. $System_Drawing_Size.Height = 22
  320. $System_Drawing_Size.Width = 584
  321. $StatusVersion.Size = $System_Drawing_Size
  322. $StatusVersion.TabIndex = 9
  323. $StatusVersion.Text = "Version: Current"
  324.  
  325. $PCRename.Controls.Add($StatusVersion)
  326.  
  327. $CompInfoTab.DataBindings.DefaultDataSourceUpdateMode = 0
  328. $CompInfoTab.HotTrack = $True
  329. $System_Drawing_Point = New-Object System.Drawing.Point
  330. $System_Drawing_Point.X = 12
  331. $System_Drawing_Point.Y = 33
  332. $CompInfoTab.Location = $System_Drawing_Point
  333. $CompInfoTab.Name = "CompInfoTab"
  334. $CompInfoTab.SelectedIndex = 0
  335. $System_Drawing_Size = New-Object System.Drawing.Size
  336. $System_Drawing_Size.Height = 351
  337. $System_Drawing_Size.Width = 560
  338. $CompInfoTab.Size = $System_Drawing_Size
  339. $CompInfoTab.TabIndex = 8
  340.  
  341. $PCRename.Controls.Add($CompInfoTab)
  342. $tabPage1.DataBindings.DefaultDataSourceUpdateMode = 0
  343. $System_Drawing_Point = New-Object System.Drawing.Point
  344. $System_Drawing_Point.X = 4
  345. $System_Drawing_Point.Y = 22
  346. $tabPage1.Location = $System_Drawing_Point
  347. $tabPage1.Name = "tabPage1"
  348. $System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding
  349. $System_Windows_Forms_Padding.All = 3
  350. $System_Windows_Forms_Padding.Bottom = 3
  351. $System_Windows_Forms_Padding.Left = 3
  352. $System_Windows_Forms_Padding.Right = 3
  353. $System_Windows_Forms_Padding.Top = 3
  354. $tabPage1.Padding = $System_Windows_Forms_Padding
  355. $System_Drawing_Size = New-Object System.Drawing.Size
  356. $System_Drawing_Size.Height = 325
  357. $System_Drawing_Size.Width = 552
  358. $tabPage1.Size = $System_Drawing_Size
  359. $tabPage1.TabIndex = 0
  360. $tabPage1.Text = "Tech Tools"
  361. $tabPage1.UseVisualStyleBackColor = $True
  362.  
  363. $CompInfoTab.Controls.Add($tabPage1)
  364.  
  365. $ViewCDriveBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  366. $ViewCDriveBTN.Enabled = $False
  367.  
  368. $System_Drawing_Point = New-Object System.Drawing.Point
  369. $System_Drawing_Point.X = 42
  370. $System_Drawing_Point.Y = 123
  371. $ViewCDriveBTN.Location = $System_Drawing_Point
  372. $ViewCDriveBTN.Name = "ViewCDriveBTN"
  373. $System_Drawing_Size = New-Object System.Drawing.Size
  374. $System_Drawing_Size.Height = 24
  375. $System_Drawing_Size.Width = 110
  376. $ViewCDriveBTN.Size = $System_Drawing_Size
  377. $ViewCDriveBTN.TabIndex = 10
  378. $ViewCDriveBTN.Text = "View C Drive"
  379. $ViewCDriveBTN.UseVisualStyleBackColor = $True
  380. $ViewCDriveBTN.add_Click($ViewCDriveBTN_OnClick)
  381.  
  382. $tabPage1.Controls.Add($ViewCDriveBTN)
  383.  
  384.  
  385.  
  386. $RDPBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  387.  
  388. $System_Drawing_Point = New-Object System.Drawing.Point
  389. $System_Drawing_Point.X = 42
  390. $System_Drawing_Point.Y = 93
  391. $RDPBTN.Location = $System_Drawing_Point
  392. $RDPBTN.Name = "RDPBTN"
  393. $System_Drawing_Size = New-Object System.Drawing.Size
  394. $System_Drawing_Size.Height = 24
  395. $System_Drawing_Size.Width = 110
  396. $RDPBTN.Size = $System_Drawing_Size
  397. $RDPBTN.TabIndex = 6
  398. $RDPBTN.Text = "Remote Desktop"
  399. $RDPBTN.UseVisualStyleBackColor = $True
  400. $RDPBTN.add_Click($RDPBTN_OnClick)
  401.  
  402. $tabPage1.Controls.Add($RDPBTN)
  403.  
  404. $ReportsGRP.DataBindings.DefaultDataSourceUpdateMode = 0
  405. $ReportsGRP.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",8.25,0,3,0)
  406. $System_Drawing_Point = New-Object System.Drawing.Point
  407. $System_Drawing_Point.X = 26
  408. $System_Drawing_Point.Y = 174
  409. $ReportsGRP.Location = $System_Drawing_Point
  410. $ReportsGRP.Name = "ReportsGRP"
  411. $System_Drawing_Size = New-Object System.Drawing.Size
  412. $System_Drawing_Size.Height = 91
  413. $System_Drawing_Size.Width = 270
  414. $ReportsGRP.Size = $System_Drawing_Size
  415. $ReportsGRP.TabIndex = 9
  416. $ReportsGRP.TabStop = $False
  417. $ReportsGRP.Text = "Reports"
  418.  
  419. $tabPage1.Controls.Add($ReportsGRP)
  420.  
  421. $SoftwareBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  422. $SoftwareBTN.Enabled = $False
  423.  
  424. $System_Drawing_Point = New-Object System.Drawing.Point
  425. $System_Drawing_Point.X = 7
  426. $System_Drawing_Point.Y = 20
  427. $SoftwareBTN.Location = $System_Drawing_Point
  428. $SoftwareBTN.Name = "SoftwareBTN"
  429. $System_Drawing_Size = New-Object System.Drawing.Size
  430. $System_Drawing_Size.Height = 23
  431. $System_Drawing_Size.Width = 133
  432. $SoftwareBTN.Size = $System_Drawing_Size
  433. $SoftwareBTN.TabIndex = 7
  434. $SoftwareBTN.Text = "Software Report"
  435. $SoftwareBTN.UseVisualStyleBackColor = $True
  436. $SoftwareBTN.add_Click($SoftwareBTN_OnClick)
  437.  
  438. $ReportsGRP.Controls.Add($SoftwareBTN)
  439.  
  440.  
  441. $hotfix_reportBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  442. $hotfix_reportBTN.Enabled = $False
  443.  
  444. $System_Drawing_Point = New-Object System.Drawing.Point
  445. $System_Drawing_Point.X = 6
  446. $System_Drawing_Point.Y = 48
  447. $hotfix_reportBTN.Location = $System_Drawing_Point
  448. $hotfix_reportBTN.Name = "hotfix_reportBTN"
  449. $System_Drawing_Size = New-Object System.Drawing.Size
  450. $System_Drawing_Size.Height = 23
  451. $System_Drawing_Size.Width = 134
  452. $hotfix_reportBTN.Size = $System_Drawing_Size
  453. $hotfix_reportBTN.TabIndex = 1
  454. $hotfix_reportBTN.Text = "Hotfix/Updates Report"
  455. $hotfix_reportBTN.UseVisualStyleBackColor = $True
  456. $hotfix_reportBTN.add_Click($hotfix_reportBTN_OnClick)
  457.  
  458. $ReportsGRP.Controls.Add($hotfix_reportBTN)
  459.  
  460.  
  461. $ExportcheckBox.DataBindings.DefaultDataSourceUpdateMode = 0
  462.  
  463. $System_Drawing_Point = New-Object System.Drawing.Point
  464. $System_Drawing_Point.X = 160
  465. $System_Drawing_Point.Y = 47
  466. $ExportcheckBox.Location = $System_Drawing_Point
  467. $ExportcheckBox.Name = "ExportcheckBox"
  468. $System_Drawing_Size = New-Object System.Drawing.Size
  469. $System_Drawing_Size.Height = 24
  470. $System_Drawing_Size.Width = 104
  471. $ExportcheckBox.Size = $System_Drawing_Size
  472. $ExportcheckBox.TabIndex = 6
  473. $ExportcheckBox.Text = "Export to Excel"
  474. $ExportcheckBox.UseVisualStyleBackColor = $True
  475.  
  476. $ReportsGRP.Controls.Add($ExportcheckBox)
  477.  
  478.  
  479.  
  480. $FindCompBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  481.  
  482. $System_Drawing_Point = New-Object System.Drawing.Point
  483. $System_Drawing_Point.X = 186
  484. $System_Drawing_Point.Y = 54
  485. $FindCompBTN.Location = $System_Drawing_Point
  486. $FindCompBTN.Name = "FindCompBTN"
  487. $System_Drawing_Size = New-Object System.Drawing.Size
  488. $System_Drawing_Size.Height = 23
  489. $System_Drawing_Size.Width = 110
  490. $FindCompBTN.Size = $System_Drawing_Size
  491. $FindCompBTN.TabIndex = 7
  492. $FindCompBTN.Text = "Find Computer"
  493. $FindCompBTN.UseVisualStyleBackColor = $True
  494. $FindCompBTN.add_Click($FindCompBTN_OnClick)
  495.  
  496. $tabPage1.Controls.Add($FindCompBTN)
  497.  
  498. $ComputerName.DataBindings.DefaultDataSourceUpdateMode = 0
  499.  
  500. $System_Drawing_Point = New-Object System.Drawing.Point
  501. $System_Drawing_Point.X = 20
  502. $System_Drawing_Point.Y = 31
  503. $ComputerName.Location = $System_Drawing_Point
  504. $ComputerName.Name = "ComputerName"
  505. $System_Drawing_Size = New-Object System.Drawing.Size
  506. $System_Drawing_Size.Height = 23
  507. $System_Drawing_Size.Width = 109
  508. $ComputerName.Size = $System_Drawing_Size
  509. $ComputerName.TabIndex = 3
  510. $ComputerName.Text = "Computer Name:"
  511. $ComputerName.add_Click($handler_label1_Click)
  512.  
  513. $tabPage1.Controls.Add($ComputerName)
  514.  
  515. $CompNameTextBOX.DataBindings.DefaultDataSourceUpdateMode = 0
  516. $CompNameTextBOX.AcceptsReturn = $True
  517. $CompNameTextBOX.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",8.25,2,3,0)
  518. $System_Drawing_Point = New-Object System.Drawing.Point
  519. $System_Drawing_Point.X = 42
  520. $System_Drawing_Point.Y = 57
  521. $CompNameTextBOX.Location = $System_Drawing_Point
  522. $CompNameTextBOX.Name = "CompNameTextBOX"
  523. $CompNameTextBox.MaxLength = 15
  524. $System_Drawing_Size = New-Object System.Drawing.Size
  525. $System_Drawing_Size.Height = 20
  526. $System_Drawing_Size.Width = 134
  527. $CompNameTextBOX.Size = $System_Drawing_Size
  528. $CompNameTextBOX.TabIndex = 2
  529.  
  530. $tabPage1.Controls.Add($CompNameTextBOX)
  531.  
  532.  
  533. $CompInfoGRP.DataBindings.DefaultDataSourceUpdateMode = 0
  534. $System_Drawing_Point = New-Object System.Drawing.Point
  535. $System_Drawing_Point.X = 342
  536. $System_Drawing_Point.Y = 24
  537. $CompInfoGRP.Location = $System_Drawing_Point
  538. $CompInfoGRP.Name = "CompInfoGRP"
  539. $System_Drawing_Size = New-Object System.Drawing.Size
  540. $System_Drawing_Size.Height = 241
  541. $System_Drawing_Size.Width = 191
  542. $CompInfoGRP.Size = $System_Drawing_Size
  543. $CompInfoGRP.TabIndex = 5
  544. $CompInfoGRP.TabStop = $False
  545. $CompInfoGRP.Text = "Computer Information"
  546.  
  547. $tabPage1.Controls.Add($CompInfoGRP)
  548. $SDIInfo.DataBindings.DefaultDataSourceUpdateMode = 0
  549. $System_Drawing_Point = New-Object System.Drawing.Point
  550. $System_Drawing_Point.X = 30
  551. $System_Drawing_Point.Y = 160
  552. $SDIInfo.Location = $System_Drawing_Point
  553. $SDIInfo.Name = "SDIInfo"
  554. $SDIInfo.ReadOnly = $True
  555. $System_Drawing_Size = New-Object System.Drawing.Size
  556. $System_Drawing_Size.Height = 13
  557. $System_Drawing_Size.Width = 145
  558. $SDIInfo.Size = $System_Drawing_Size
  559. $SDIInfo.TabIndex = 7
  560. $SDIInfo.Text = "SDI XX.XX"
  561.  
  562. $CompInfoGRP.Controls.Add($SDIInfo)
  563.  
  564.  
  565. $LoginInfo.DataBindings.DefaultDataSourceUpdateMode = 0
  566. $System_Drawing_Point = New-Object System.Drawing.Point
  567. $System_Drawing_Point.X = 30
  568. $System_Drawing_Point.Y = 105
  569. $LoginInfo.Location = $System_Drawing_Point
  570. $LoginInfo.Name = "LoginInfo"
  571. $LoginInfo.ReadOnly = $True
  572. $System_Drawing_Size = New-Object System.Drawing.Size
  573. $System_Drawing_Size.Height = 13
  574. $System_Drawing_Size.Width = 145
  575. $LoginInfo.Size = $System_Drawing_Size
  576. $LoginInfo.TabIndex = 6
  577. $LoginInfo.Text = "UserName"
  578.  
  579. $CompInfoGRP.Controls.Add($LoginInfo)
  580.  
  581. $tabPage1.Controls.Add($CompInfoGRP)
  582. $IPInfo.DataBindings.DefaultDataSourceUpdateMode = 0
  583. $System_Drawing_Point = New-Object System.Drawing.Point
  584. $System_Drawing_Point.X = 30
  585. $System_Drawing_Point.Y = 44
  586. $IPInfo.Location = $System_Drawing_Point
  587. $IPInfo.Multiline = $True
  588. $IPInfo.Name = "IPInfo"
  589. $IPInfo.ReadOnly = $True
  590. $System_Drawing_Size = New-Object System.Drawing.Size
  591. $System_Drawing_Size.Height = 35
  592. $System_Drawing_Size.Width = 145
  593. $IPInfo.Size = $System_Drawing_Size
  594. $IPInfo.TabIndex = 8
  595. $IPInfo.Text = "192.1.1.1"
  596.  
  597. $CompInfoGRP.Controls.Add($IPInfo)
  598.  
  599. $ImageLab.DataBindings.DefaultDataSourceUpdateMode = 0
  600.  
  601. $System_Drawing_Point = New-Object System.Drawing.Point
  602. $System_Drawing_Point.X = 7
  603. $System_Drawing_Point.Y = 134
  604. $ImageLab.Location = $System_Drawing_Point
  605. $ImageLab.Name = "ImageLab"
  606. $System_Drawing_Size = New-Object System.Drawing.Size
  607. $System_Drawing_Size.Height = 23
  608. $System_Drawing_Size.Width = 100
  609. $ImageLab.Size = $System_Drawing_Size
  610. $ImageLab.TabIndex = 2
  611. $ImageLab.Text = "SDI Image:"
  612. $ImageLab.add_Click($handler_label4_Click)
  613.  
  614. $CompInfoGRP.Controls.Add($ImageLab)
  615.  
  616. $LoginLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  617.  
  618. $System_Drawing_Point = New-Object System.Drawing.Point
  619. $System_Drawing_Point.X = 7
  620. $System_Drawing_Point.Y = 82
  621. $LoginLabel.Location = $System_Drawing_Point
  622. $LoginLabel.Name = "LoginLabel"
  623. $System_Drawing_Size = New-Object System.Drawing.Size
  624. $System_Drawing_Size.Height = 23
  625. $System_Drawing_Size.Width = 100
  626. $LoginLabel.Size = $System_Drawing_Size
  627. $LoginLabel.TabIndex = 1
  628. $LoginLabel.Text = "Last Login:"
  629. $LoginLabel.add_Click($handler_label3_Click)
  630.  
  631. $CompInfoGRP.Controls.Add($LoginLabel)
  632.  
  633. $IPLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  634.  
  635. $System_Drawing_Point = New-Object System.Drawing.Point
  636. $System_Drawing_Point.X = 7
  637. $System_Drawing_Point.Y = 30
  638. $IPLabel.Location = $System_Drawing_Point
  639. $IPLabel.Name = "IPLabel"
  640. $System_Drawing_Size = New-Object System.Drawing.Size
  641. $System_Drawing_Size.Height = 23
  642. $System_Drawing_Size.Width = 80
  643. $IPLabel.Size = $System_Drawing_Size
  644. $IPLabel.TabIndex = 0
  645. $IPLabel.Text = "IP:"
  646. $IPLabel.add_Click($handler_IPLabel_Click)
  647.  
  648. $CompInfoGRP.Controls.Add($IPLabel)
  649.  
  650.  
  651.  
  652. $tabPage2.DataBindings.DefaultDataSourceUpdateMode = 0
  653. $System_Drawing_Point = New-Object System.Drawing.Point
  654. $System_Drawing_Point.X = 4
  655. $System_Drawing_Point.Y = 22
  656. $tabPage2.Location = $System_Drawing_Point
  657. $tabPage2.Name = "tabPage2"
  658. $System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding
  659. $System_Windows_Forms_Padding.All = 3
  660. $System_Windows_Forms_Padding.Bottom = 3
  661. $System_Windows_Forms_Padding.Left = 3
  662. $System_Windows_Forms_Padding.Right = 3
  663. $System_Windows_Forms_Padding.Top = 3
  664. $tabPage2.Padding = $System_Windows_Forms_Padding
  665. $System_Drawing_Size = New-Object System.Drawing.Size
  666. $System_Drawing_Size.Height = 325
  667. $System_Drawing_Size.Width = 552
  668. $tabPage2.Size = $System_Drawing_Size
  669. $tabPage2.TabIndex = 1
  670. $tabPage2.Text = "Remote PC Rename"
  671. $tabPage2.UseVisualStyleBackColor = $True
  672.  
  673. $System_Drawing_Point = New-Object System.Drawing.Point
  674. $System_Drawing_Point.X = 327
  675. $System_Drawing_Point.Y = 77
  676. $QueryHelpLabel.Location = $System_Drawing_Point
  677. $QueryHelpLabel.Name = "QueryHelpLabel"
  678. $System_Drawing_Size = New-Object System.Drawing.Size
  679. $System_Drawing_Size.Height = 47
  680. $System_Drawing_Size.Width = 157
  681. $QueryHelpLabel.Size = $System_Drawing_Size
  682. $QueryHelpLabel.TabIndex = 9
  683. $QueryHelpLabel.Text = "Enter full computer name or just first five of comptuer name"
  684. $QueryHelpLabel.add_Click($handler_QueryHelpLabel_Click)
  685.  
  686. $tabPage2.Controls.Add($QueryHelpLabel)
  687.  
  688. $CompInfoTab.Controls.Add($tabPage2)
  689. $QueryADBox.DataBindings.DefaultDataSourceUpdateMode = 0
  690. $QueryADBox.AcceptsReturn = $True
  691. $QueryADBox.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",8.25,2,3,0)
  692. $System_Drawing_Point = New-Object System.Drawing.Point
  693. $System_Drawing_Point.X = 327
  694. $System_Drawing_Point.Y = 50
  695. $QueryADBox.Location = $System_Drawing_Point
  696. $QueryADBox.MaxLength = 15
  697. $QueryADBox.Name = "QueryADBox"
  698. $System_Drawing_Size = New-Object System.Drawing.Size
  699. $System_Drawing_Size.Height = 20
  700. $System_Drawing_Size.Width = 134
  701. $QueryADBox.Size = $System_Drawing_Size
  702. $QueryADBox.TabIndex = 8
  703.  
  704. $tabPage2.Controls.Add($QueryADBox)
  705.  
  706. $QueryLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  707.  
  708. $System_Drawing_Point = New-Object System.Drawing.Point
  709. $System_Drawing_Point.X = 304
  710. $System_Drawing_Point.Y = 24
  711. $QueryLabel.Location = $System_Drawing_Point
  712. $QueryLabel.Name = "QueryLabel"
  713. $System_Drawing_Size = New-Object System.Drawing.Size
  714. $System_Drawing_Size.Height = 23
  715. $System_Drawing_Size.Width = 157
  716. $QueryLabel.Size = $System_Drawing_Size
  717. $QueryLabel.TabIndex = 7
  718. $QueryLabel.Text = "Query AD:"
  719.  
  720. $tabPage2.Controls.Add($QueryLabel)
  721.  
  722.  
  723. $QueryADBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  724.  
  725. $System_Drawing_Point = New-Object System.Drawing.Point
  726. $System_Drawing_Point.X = 304
  727. $System_Drawing_Point.Y = 154
  728. $QueryADBTN.Location = $System_Drawing_Point
  729. $QueryADBTN.Name = "QueryADBTN"
  730. $System_Drawing_Size = New-Object System.Drawing.Size
  731. $System_Drawing_Size.Height = 23
  732. $System_Drawing_Size.Width = 133
  733. $QueryADBTN.Size = $System_Drawing_Size
  734. $QueryADBTN.TabIndex = 6
  735. $QueryADBTN.Text = "Query AD"
  736. $QueryADBTN.UseVisualStyleBackColor = $True
  737. $QueryADBTN.add_Click($QueryADBTN_OnClick)
  738.  
  739. $tabPage2.Controls.Add($QueryADBTN)
  740.  
  741. $WarningLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  742.  
  743. $System_Drawing_Point = New-Object System.Drawing.Point
  744. $System_Drawing_Point.X = 31
  745. $System_Drawing_Point.Y = 194
  746. $WarningLabel.Location = $System_Drawing_Point
  747. $WarningLabel.Name = "WarningLabel"
  748. $System_Drawing_Size = New-Object System.Drawing.Size
  749. $System_Drawing_Size.Height = 54
  750. $System_Drawing_Size.Width = 158
  751. $WarningLabel.Size = $System_Drawing_Size
  752. $WarningLabel.TabIndex = 5
  753. $WarningLabel.Text = "WARNING: This action cannot be undone.  Be sure this is the computer you want to rename."
  754.  
  755. $tabPage2.Controls.Add($WarningLabel)
  756.  
  757.  
  758. $RenameCompBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  759.  
  760. $System_Drawing_Point = New-Object System.Drawing.Point
  761. $System_Drawing_Point.X = 31
  762. $System_Drawing_Point.Y = 154
  763. $RenameCompBTN.Location = $System_Drawing_Point
  764. $RenameCompBTN.Name = "RenameCompBTN"
  765. $System_Drawing_Size = New-Object System.Drawing.Size
  766. $System_Drawing_Size.Height = 23
  767. $System_Drawing_Size.Width = 149
  768. $RenameCompBTN.Size = $System_Drawing_Size
  769. $RenameCompBTN.TabIndex = 4
  770. $RenameCompBTN.Text = "Rename Computer"
  771. $RenameCompBTN.UseVisualStyleBackColor = $True
  772. $RenameCompBTN.add_Click($RenameCompBTN_OnClick)
  773.  
  774. $tabPage2.Controls.Add($RenameCompBTN)
  775.  
  776. $NewCompBox.DataBindings.DefaultDataSourceUpdateMode = 0
  777. $NewCompBox.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",8.25,2,3,0)
  778. $System_Drawing_Point = New-Object System.Drawing.Point
  779. $System_Drawing_Point.X = 41
  780. $System_Drawing_Point.Y = 104
  781. $NewCompBox.Location = $System_Drawing_Point
  782. $NewCompBox.Name = "NewCompBox"
  783. $NewCompBox.MaxLength = 15
  784. $System_Drawing_Size = New-Object System.Drawing.Size
  785. $System_Drawing_Size.Height = 20
  786. $System_Drawing_Size.Width = 139
  787. $NewCompBox.Size = $System_Drawing_Size
  788. $NewCompBox.TabIndex = 3
  789.  
  790. $tabPage2.Controls.Add($NewCompBox)
  791.  
  792. $CUCompNameBox.DataBindings.DefaultDataSourceUpdateMode = 0
  793. $CUCompNameBox.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",8.25,2,3,0)
  794. $System_Drawing_Point = New-Object System.Drawing.Point
  795. $System_Drawing_Point.X = 41
  796. $System_Drawing_Point.Y = 50
  797. $CUCompNameBox.Location = $System_Drawing_Point
  798. $CUCompNameBox.Name = "CUCompNameBox"
  799. $CUCompNameBox.MaxLength = 15
  800. $System_Drawing_Size = New-Object System.Drawing.Size
  801. $System_Drawing_Size.Height = 20
  802. $System_Drawing_Size.Width = 139
  803. $CUCompNameBox.Size = $System_Drawing_Size
  804. $CUCompNameBox.TabIndex = 2
  805.  
  806. $tabPage2.Controls.Add($CUCompNameBox)
  807.  
  808. $NewCompName.DataBindings.DefaultDataSourceUpdateMode = 0
  809.  
  810. $System_Drawing_Point = New-Object System.Drawing.Point
  811. $System_Drawing_Point.X = 9
  812. $System_Drawing_Point.Y = 77
  813. $NewCompName.Location = $System_Drawing_Point
  814. $NewCompName.Name = "NewCompName"
  815. $System_Drawing_Size = New-Object System.Drawing.Size
  816. $System_Drawing_Size.Height = 23
  817. $System_Drawing_Size.Width = 121
  818. $NewCompName.Size = $System_Drawing_Size
  819. $NewCompName.TabIndex = 1
  820. $NewCompName.Text = "New Computer Name:"
  821.  
  822. $tabPage2.Controls.Add($NewCompName)
  823.  
  824. $OldCompName.DataBindings.DefaultDataSourceUpdateMode = 0
  825.  
  826. $System_Drawing_Point = New-Object System.Drawing.Point
  827. $System_Drawing_Point.X = 9
  828. $System_Drawing_Point.Y = 24
  829. $OldCompName.Location = $System_Drawing_Point
  830. $OldCompName.Name = "OldCompName"
  831. $System_Drawing_Size = New-Object System.Drawing.Size
  832. $System_Drawing_Size.Height = 23
  833. $System_Drawing_Size.Width = 138
  834. $OldCompName.Size = $System_Drawing_Size
  835. $OldCompName.TabIndex = 0
  836. $OldCompName.Text = "Current Computer Name:"
  837.  
  838. $tabPage2.Controls.Add($OldCompName)
  839. ####Tab3
  840.  
  841.  
  842. $tabPage3.DataBindings.DefaultDataSourceUpdateMode = 0
  843. $System_Drawing_Point = New-Object System.Drawing.Point
  844. $System_Drawing_Point.X = 4
  845. $System_Drawing_Point.Y = 22
  846. $tabPage3.Location = $System_Drawing_Point
  847. $tabPage3.Name = "tabPage3"
  848. $System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding
  849. $System_Windows_Forms_Padding.All = 3
  850. $System_Windows_Forms_Padding.Bottom = 3
  851. $System_Windows_Forms_Padding.Left = 3
  852. $System_Windows_Forms_Padding.Right = 3
  853. $System_Windows_Forms_Padding.Top = 3
  854. $tabPage3.Padding = $System_Windows_Forms_Padding
  855. $System_Drawing_Size = New-Object System.Drawing.Size
  856. $System_Drawing_Size.Height = 325
  857. $System_Drawing_Size.Width = 552
  858. $tabPage3.Size = $System_Drawing_Size
  859. $tabPage3.TabIndex = 2
  860. $tabPage3.Text = "Current System"
  861. $tabPage3.UseVisualStyleBackColor = $True
  862.  
  863. $CompInfoTab.Controls.Add($tabPage3)
  864.  
  865. $aboutbox.DataBindings.DefaultDataSourceUpdateMode = 0
  866. $System_Drawing_Point = New-Object System.Drawing.Point
  867. $System_Drawing_Point.X = 340
  868. $System_Drawing_Point.Y = 29
  869. $aboutbox.Location = $System_Drawing_Point
  870. $aboutbox.Name = "aboutbox"
  871. $System_Drawing_Size = New-Object System.Drawing.Size
  872. $System_Drawing_Size.Height = 169
  873. $System_Drawing_Size.Width = 191
  874. $aboutbox.Size = $System_Drawing_Size
  875. $aboutbox.TabIndex = 13
  876. $aboutbox.TabStop = $False
  877. $aboutbox.Text = "About/Support"
  878.  
  879. $tabPage3.Controls.Add($aboutbox)
  880. $AboutLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  881. $System_Drawing_Point = New-Object System.Drawing.Point
  882. $System_Drawing_Point.X = 7
  883. $System_Drawing_Point.Y = 16
  884. $AboutLabel.Location = $System_Drawing_Point
  885. $AboutLabel.Multiline = $True
  886. $AboutLabel.Name = "AboutLabel"
  887. $AboutLabel.ReadOnly = $True
  888. $System_Drawing_Size = New-Object System.Drawing.Size
  889. $System_Drawing_Size.Height = 91
  890. $System_Drawing_Size.Width = 178
  891. $AboutLabel.Size = $System_Drawing_Size
  892. $AboutLabel.TabIndex = 19
  893. $AboutLabel.Text = "PCRenamifer v3.1
  894.  
  895. Questions or Support?
  896.  
  897. $aboutbox.Controls.Add($AboutLabel)
  898.  
  899.  
  900.  
  901. $CUSGetInfoBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  902. $CUSGetInfoBTN.FlatAppearance.MouseOverBackColor = [System.Drawing.Color]::FromArgb(255,255,255,255)
  903.  
  904. $System_Drawing_Point = New-Object System.Drawing.Point
  905. $System_Drawing_Point.X = 22
  906. $System_Drawing_Point.Y = 155
  907. $CUSGetInfoBTN.Location = $System_Drawing_Point
  908. $CUSGetInfoBTN.Name = "CUSGetInfoBTN"
  909. $System_Drawing_Size = New-Object System.Drawing.Size
  910. $System_Drawing_Size.Height = 23
  911. $System_Drawing_Size.Width = 156
  912. $CUSGetInfoBTN.Size = $System_Drawing_Size
  913. $CUSGetInfoBTN.TabIndex = 12
  914. $CUSGetInfoBTN.Text = "Get Info"
  915. $CUSGetInfoBTN.UseVisualStyleBackColor = $True
  916. $CUSGetInfoBTN.add_Click($CUSGetInfoBTN_OnClick)
  917.  
  918. $tabPage3.Controls.Add($CUSGetInfoBTN)
  919.  
  920.  
  921. $CUSSoftwareBTN.DataBindings.DefaultDataSourceUpdateMode = 0
  922. $CUSSoftwareBTN.Enabled = $False
  923.  
  924. $System_Drawing_Point = New-Object System.Drawing.Point
  925. $System_Drawing_Point.X = 22
  926. $System_Drawing_Point.Y = 195
  927. $CUSSoftwareBTN.Location = $System_Drawing_Point
  928. $CUSSoftwareBTN.Name = "CUSSoftwareBTN"
  929. $System_Drawing_Size = New-Object System.Drawing.Size
  930. $System_Drawing_Size.Height = 23
  931. $System_Drawing_Size.Width = 156
  932. $CUSSoftwareBTN.Size = $System_Drawing_Size
  933. $CUSSoftwareBTN.TabIndex = 11
  934. $CUSSoftwareBTN.Text = "View Software"
  935. $CUSSoftwareBTN.UseVisualStyleBackColor = $True
  936. $CUSSoftwareBTN.add_Click($CUSSoftwareBTN_OnClick)
  937.  
  938. $tabPage3.Controls.Add($CUSSoftwareBTN)
  939.  
  940.  
  941. $CUSModelOut.DataBindings.DefaultDataSourceUpdateMode = 0
  942. $System_Drawing_Point = New-Object System.Drawing.Point
  943. $System_Drawing_Point.X = 111
  944. $System_Drawing_Point.Y = 74
  945. $CUSModelOut.Location = $System_Drawing_Point
  946. $CUSModelOut.Name = "CUSModelOut"
  947. $CUSModelOut.ReadOnly = $True
  948. $System_Drawing_Size = New-Object System.Drawing.Size
  949. $System_Drawing_Size.Height = 20
  950. $System_Drawing_Size.Width = 141
  951. $CUSModelOut.Size = $System_Drawing_Size
  952. $CUSModelOut.TabIndex = 16
  953. $CUSModelOut.Text = "Current Model"
  954.  
  955. $tabPage3.Controls.Add($CUSModelOut)
  956.  
  957. $CUSCompModel.DataBindings.DefaultDataSourceUpdateMode = 0
  958.  
  959. $System_Drawing_Point = New-Object System.Drawing.Point
  960. $System_Drawing_Point.X = 22
  961. $System_Drawing_Point.Y = 83
  962. $CUSCompModel.Location = $System_Drawing_Point
  963. $CUSCompModel.Name = "CUSCompModel"
  964. $System_Drawing_Size = New-Object System.Drawing.Size
  965. $System_Drawing_Size.Height = 23
  966. $System_Drawing_Size.Width = 83
  967. $CUSCompModel.Size = $System_Drawing_Size
  968. $CUSCompModel.TabIndex = 9
  969. $CUSCompModel.Text = "Model"
  970.  
  971. $tabPage3.Controls.Add($CUSCompModel)
  972.  
  973. $CUSSDIOut.DataBindings.DefaultDataSourceUpdateMode = 0
  974. $System_Drawing_Point = New-Object System.Drawing.Point
  975. $System_Drawing_Point.X = 111
  976. $System_Drawing_Point.Y = 126
  977. $CUSSDIOut.Location = $System_Drawing_Point
  978. $CUSSDIOut.Name = "CUSSDIOut"
  979. $CUSSDIOut.ReadOnly = $True
  980. $System_Drawing_Size = New-Object System.Drawing.Size
  981. $System_Drawing_Size.Height = 20
  982. $System_Drawing_Size.Width = 141
  983. $CUSSDIOut.Size = $System_Drawing_Size
  984. $CUSSDIOut.TabIndex = 18
  985. $CUSSDIOut.Text = "Current SDI"
  986.  
  987. $tabPage3.Controls.Add($CUSSDIOut)
  988.  
  989. $CUSSerialOut.DataBindings.DefaultDataSourceUpdateMode = 0
  990. $System_Drawing_Point = New-Object System.Drawing.Point
  991. $System_Drawing_Point.X = 111
  992. $System_Drawing_Point.Y = 100
  993. $CUSSerialOut.Location = $System_Drawing_Point
  994. $CUSSerialOut.Name = "CUSSerialOut"
  995. $CUSSerialOut.ReadOnly = $True
  996. $System_Drawing_Size = New-Object System.Drawing.Size
  997. $System_Drawing_Size.Height = 20
  998. $System_Drawing_Size.Width = 141
  999. $CUSSerialOut.Size = $System_Drawing_Size
  1000. $CUSSerialOut.TabIndex = 17
  1001. $CUSSerialOut.Text = "Current Serial"
  1002.  
  1003. $tabPage3.Controls.Add($CUSSerialOut)
  1004.  
  1005. $CUSIPOut.DataBindings.DefaultDataSourceUpdateMode = 0
  1006. $System_Drawing_Point = New-Object System.Drawing.Point
  1007. $System_Drawing_Point.X = 111
  1008. $System_Drawing_Point.Y = 42
  1009. $CUSIPOut.Location = $System_Drawing_Point
  1010. $CUSIPOut.Name = "CUSIPOut"
  1011. $CUSIPOut.ReadOnly = $True
  1012. $CUSIPOut.Multiline = $True
  1013. $System_Drawing_Size = New-Object System.Drawing.Size
  1014. $System_Drawing_Size.Height = 20
  1015. $System_Drawing_Size.Width = 141
  1016. $CUSIPOut.Size = $System_Drawing_Size
  1017. $CUSIPOut.TabIndex = 15
  1018. $CUSIPOut.Text = "Current IP"
  1019.  
  1020. $tabPage3.Controls.Add($CUSIPOut)
  1021.  
  1022.  
  1023. $CUSCompNameOut.DataBindings.DefaultDataSourceUpdateMode = 0
  1024. $System_Drawing_Point = New-Object System.Drawing.Point
  1025. $System_Drawing_Point.X = 111
  1026. $System_Drawing_Point.Y = 17
  1027. $CUSCompNameOut.Location = $System_Drawing_Point
  1028. $CUSCompNameOut.Name = "CUSCompNameOut"
  1029. $CUSCompNameOut.ReadOnly = $True
  1030. $System_Drawing_Size = New-Object System.Drawing.Size
  1031. $System_Drawing_Size.Height = 20
  1032. $System_Drawing_Size.Width = 141
  1033. $CUSCompNameOut.Size = $System_Drawing_Size
  1034. $CUSCompNameOut.TabIndex = 14
  1035. $CUSCompNameOut.Text = "Current Name"
  1036.  
  1037. $tabPage3.Controls.Add($CUSCompNameOut)
  1038. $CUSSDILabel.DataBindings.DefaultDataSourceUpdateMode = 0
  1039.  
  1040. $System_Drawing_Point = New-Object System.Drawing.Point
  1041. $System_Drawing_Point.X = 22
  1042. $System_Drawing_Point.Y = 129
  1043. $CUSSDILabel.Location = $System_Drawing_Point
  1044. $CUSSDILabel.Name = "CUSSDILabel"
  1045. $System_Drawing_Size = New-Object System.Drawing.Size
  1046. $System_Drawing_Size.Height = 23
  1047. $System_Drawing_Size.Width = 100
  1048. $CUSSDILabel.Size = $System_Drawing_Size
  1049. $CUSSDILabel.TabIndex = 4
  1050. $CUSSDILabel.Text = "SDI:"
  1051.  
  1052. $tabPage3.Controls.Add($CUSSDILabel)
  1053.  
  1054. $CUSCompSsLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  1055.  
  1056. $System_Drawing_Point = New-Object System.Drawing.Point
  1057. $System_Drawing_Point.X = 22
  1058. $System_Drawing_Point.Y = 106
  1059. $CUSCompSsLabel.Location = $System_Drawing_Point
  1060. $CUSCompSsLabel.Name = "CUSCompSsLabel"
  1061. $System_Drawing_Size = New-Object System.Drawing.Size
  1062. $System_Drawing_Size.Height = 23
  1063. $System_Drawing_Size.Width = 100
  1064. $CUSCompSsLabel.Size = $System_Drawing_Size
  1065. $CUSCompSsLabel.TabIndex = 2
  1066. $CUSCompSsLabel.Text = "Serial Number:"
  1067.  
  1068. $tabPage3.Controls.Add($CUSCompSsLabel)
  1069.  
  1070. $CUSCompIpLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  1071.  
  1072. $System_Drawing_Point = New-Object System.Drawing.Point
  1073. $System_Drawing_Point.X = 22
  1074. $System_Drawing_Point.Y = 45
  1075. $CUSCompIpLabel.Location = $System_Drawing_Point
  1076. $CUSCompIpLabel.Name = "CUSCompIpLabel"
  1077. $System_Drawing_Size = New-Object System.Drawing.Size
  1078. $System_Drawing_Size.Height = 23
  1079. $System_Drawing_Size.Width = 83
  1080. $CUSCompIpLabel.Size = $System_Drawing_Size
  1081. $CUSCompIpLabel.TabIndex = 1
  1082. $CUSCompIpLabel.Text = "IP:"
  1083.  
  1084. $tabPage3.Controls.Add($CUSCompIpLabel)
  1085.  
  1086. $CUSCompNameLabel.DataBindings.DefaultDataSourceUpdateMode = 0
  1087.  
  1088. $System_Drawing_Point = New-Object System.Drawing.Point
  1089. $System_Drawing_Point.X = 22
  1090. $System_Drawing_Point.Y = 20
  1091. $CUSCompNameLabel.Location = $System_Drawing_Point
  1092. $CUSCompNameLabel.Name = "CUSCompNameLabel"
  1093. $System_Drawing_Size = New-Object System.Drawing.Size
  1094. $System_Drawing_Size.Height = 23
  1095. $System_Drawing_Size.Width = 100
  1096. $CUSCompNameLabel.Size = $System_Drawing_Size
  1097. $CUSCompNameLabel.TabIndex = 0
  1098. $CUSCompNameLabel.Text = "Computer Name: "
  1099.  
  1100. $tabPage3.Controls.Add($CUSCompNameLabel)
  1101.  
  1102.  
  1103. #endregion Generated Form Code
  1104.  
  1105. #Save the initial state of the form
  1106. $InitialFormWindowState = $PCRename.WindowState
  1107. #Init the OnLoad event to correct the initial state of the form
  1108. $PCRename.add_Load($OnLoadForm_StateCorrection)
  1109. #Show the Form
  1110. $PCRename.ShowDialog()| Out-Null
  1111.  
  1112. } #End Function
  1113.  
  1114. #Call the Function
  1115. GenerateForm
Advertisement
Add Comment
Please, Sign In to add comment