PowerShell(Windows System Admin) – Math Problem Example

Download full paperFile format: .doc, available for editing

$a = New-Object -comobject Excel. Application$a. visible = $True $b = $a. Workbooks. Add()$c = $b. Worksheets. Item(1)$c. Cells. Item(1,1) = "Name"$c. Cells. Item(1,2) = "Version"$c. Cells. Item(1,3) = "Publisher"$c. Cells. Item(1,4) = "InstalledOn"$c. Cells. Item(1,5) = "HelpLink"$c. Cells. Item(1,6) = "UninstallString" (Stevenson, 2005)$d = $c. UsedRange$d. Interior. ColorIndex = 19$d. Font. ColorIndex = 11$d. Font. Bold = $True$intRow = 2$Keys = Get-ChildItem HKLM: \Software\Microsoft\Windows\CurrentVersion\Uninstall$Items = $keys |foreach-object {Get-ItemProperty $_. PsPath}foreach ($item in $items){$c. Cells. Item($intRow, 1) = $item. Displayname$c. Cells. Item($intRow, 2) = $item. DisplayVersion$c. Cells. Item($intRow, 3) = $item. Publisher$c. Cells. Item($intRow, 4) = $item. InstallDate$c. Cells. Item($intRow, 5) = $item. HelpLink$c. Cells. Item($intRow, 6) = $item. UninstallString$intRow = $intRow + 1}$d. EntireColumn. AutoFit()#PowerShell script to get the BIOS details of a computer$computer = "LocalHost" $namespace = "root\CIMV2" Get-WmiObject -class Win32_BIOS -computername $computer -namespace $namespace#PowerShell to get the installed printers$computer = "LocalHost" $namespace = "root\CIMV2" Get-WmiObject -class Win32_Printer -computername $computer -namespace $namespace (Scott, 2007)#Processor architecture information using powershell$computer = "LocalHost" $namespace = "root\CIMV2" Get-WmiObject -class Win32_Processor -computername $computer -namespace $namespace (Sankar et al, 2009)########################################################Command for window (question 8)[void] [System. Reflection. Assembly]: :LoadWithPartialName("System. Drawing") [void] [System. Reflection. Assembly]: :LoadWithPartialName("System. Windows. Forms") $objForm = New-Object System. Windows. Forms. Form $objForm. Text = "Data Entry Form"$objForm. Size = New-Object System. Drawing. Size(300,200) $objForm. StartPosition = "CenterScreen"$objForm. KeyPreview = $True$objForm. Add_KeyDown({if ($_. KeyCode -eq "Enter") {$x=$objTextBox. Text; $objForm. Close()}})$objForm. Add_KeyDown({if ($_. KeyCode -eq "Escape") {$objForm. Close()}})$OKButton = New-Object System. Windows. Forms. Button$OKButton. Location = New-Object System. Drawing. Size(75,120)$OKButton. Size = New-Object System. Drawing. Size(75,23)$OKButton. Text = "OK"$OKButton. Add_Click({$x=$objTextBox. Text; $objForm. Close()})$objForm. Controls. Add($OKButton)$CancelButton = New-Object System. Windows. Forms. Button$CancelButton. Location = New-Object System. Drawing. Size(150,120)$CancelButton. Size = New-Object System. Drawing. Size(75,23)$CancelButton. Text = "Cancel"$CancelButton. Add_Click({$objForm. Close()})$objForm. Controls. Add($CancelButton)$objLabel = New-Object System. Windows. Forms. Label$objLabel. Location = New-Object System. Drawing. Size(10,20) $objLabel. Size = New-Object System. Drawing. Size(280,20) $objLabel. Text = "Please enter the information in the space below: "$objForm. Controls. Add($objLabel) $objTextBox = New-Object System. Windows. Forms. TextBox $objTextBox. Location = New-Object System. Drawing. Size(10,40) $objTextBox. Size = New-Object System. Drawing. Size(260,20) $objForm. Controls. Add($objTextBox) $objForm. Topmost = $True$objForm. Add_Shown({$objForm. Activate()})[void] $objForm. ShowDialog()$x################################Command for modifying registry so that th eNumLock key is on on computer booting(Question 9)$path = "HKCU: \Control Panel\Keyboard"Set-ItemProperty -Path $path -Name "InitialKeyboardIndicators" -Value "2"! #################################Command to modify the registry so that when a folder is right-clicked a command prompt option is available and the folder will be the active directory (10). New-ItemProperty -Path HKCR: \Directory\shell -Name "OpenNew" -Value "Open The Command Prompt"New-ItemProperty -Path HKCR: \Directory\shell\OpenNew -Name "Command" -Value "cmd. exe /k cd %1"ReferencesStevenson, N.

(2005). PowerShell for dummies. For Dummies. Scott, J. (2007). The new rules of Cmdlet. John Wiley and SonsBaroudi, C., Hill, J., Reinhold, A., & Senxian, J. (2009). Scripting in PowerShell. For Dummies. Sankar, K., Bouchard, S., & Mancini, D. (2009). .NET Framework fundamentals. Cisco Press. Winfield, L., & Spielman, S. (2003). Scripting with VBScript. Amacom Div American Mgmt Assn.

Download full paperFile format: .doc, available for editing
Contact Us