Created
October 28, 2015 14:09
-
-
Save torgro/50dacd91ad718dd9b336 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($vdi in $vdis) | |
{ | |
$n = $vdi.name | |
$AdComputer = Get-ADComputer -identity $n -ErrorAction SilentlyContinue | |
$Citrix = Get-BrokerMachine -HostedMachineName $n #-ErrorAction SilentlyContinue | |
$VmWare = Get-ProvVM -VMName $n #-ErrorAction SilentlyContinue | |
if($AdComputer) | |
{ | |
#Exists in AD, do action here, read from console what ever | |
} | |
if($Citrix) | |
{ | |
#Exists in Citrix, do action here, read from console what ever | |
} | |
if($VmWare) | |
{ | |
#Exists in VmWare, do action here, read from console what ever | |
} | |
#Or all together | |
if($AdComputer -or $Citrix -or $VmWare) | |
{ | |
#One the objects are not null, do action | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment