Archive for March 22nd, 2010

Test if AD object/path exists

This Test-QADObject (Test-QADPath) function I have created gives a quick true or false answer on whether a specific user, computer, group, OU already exists in your domain.

Test-QADObject dsotniko

Test-QADObject 'OU=demo,DC=quest,DC=local'

Test-QADPath k*

I have posted the whole code with proper help and parameter handling to poshcode. Here’s a simplified one for the blog:

function Test-QADObject {
 param($Identity)
 
 (Get-QADObject $Identity -DontUseDefaultIncludedProperties `
  -WarningAction SilentlyContinue -ErrorAction SilentlyContinue `
  -SizeLimit 1) -ne $null
}

My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

March 2010
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

%d bloggers like this: