0

Let's say I do this:

Get-ADUser -SearchBase $search_base -filter {
     (GivenName -eq $firstname) -and (SN -eq $surname)
}

Doe this return the user object for true and if not found a simple $false?

Same question for the rest of the cmdlets

1
  • 2
    ... or checked the cmdlet help which describes the return type? Commented Mar 19, 2012 at 16:02

1 Answer 1

3

The verb Get in Get-ADUser signifies that it will return an ADUser (or $null). Cmdlets that return booleans ($true or $false) use the verb Test. The scriptblock you're passing as a filter is used to decide on which ADUser objects the cmdlet will return.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.