GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST1861/Resources/Week/13/ |
Upload File : |
<# .Synopsis Checks if computer account exists for computer names provided .DESCRIPTION Checks if computer account exists for computer names provided .EXAMPLE Get-ADExistence $computers .EXAMPLE Get-ADExistence "computer1","computer2" #> function Get-ADExistence{ [CmdletBinding()] Param( # single or array of machine names [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, HelpMessage="Enter one or multiple computer names")] [String[]]$Computers ) Begin{} Process { foreach ($computer in $computers) { try { $comp = get-adcomputer $computer -ErrorAction stop $properties = @{computername = $computer Enabled = $comp.enabled InAD = 'Yes'} } catch { $properties = @{computername = $computer Enabled = 'Fat Chance' InAD = 'No'} Write-Output $properties } finally { Write-Output $properties $obj = New-Object -TypeName psobject -Property $properties Write-Output $obj } } #End foreach } #End Process End{} } #End Function