Hi Team,
I am new to the quest powershell and I am using Quest One ActiveRoles Management Shell for Active Directory for querying the active directory. When i try to query whether a server is present in AD or not it throws an error message: Get-QADComputer : Index was outside the bounds of the array.
Here is my code. please help me in finding out where i am going wrong.
param( [Parameter(Mandatory=$true)] [string]$hostnames, [Parameter(Mandatory=$true)] [string]$AD_SA_id, [Parameter(Mandatory=$true)] $ADpswd ) $Password = ConvertTo-SecureString -String $ADpswd -AsPlainText -Force $Cred = New-Object System.Management.Automation.PsCredential("$AD_SA_id",$password) $test = Get-QADComputer -Identity $hostnames -Credential $Cred if($test -ne $null) { "$hostnames found in AD" } else { "$hostnames not found in AD" }
Thanks in advance!