Search Results

Search found 2 results on 1 pages for 'dboftlp'.

Page 1/1 | 1 

  • Get-QADComputer -LdapFilter & variables

    - by dboftlp
    Can I use a variable in and LdapFilter with Get-QADComputer? i.e.: $31DaysAgo = (Get-Date).AddDays(-31) $ft = $31DaysAgo.ToFileTime() $StComps = Get-QADComputer -SizeLimit 0 -IncludeAllProperties -SearchRoot ` 'DC=MY,DC=DOMAIN,DC=LOCAL' -LdapFilter '(&(objectcategory=computer) ` (pwdLastSet<=$ft)(|(operatingsystem=Windows 2000 Professional) ` (operatingSystem=Windows XP*)(operatingSystem=Windows 7*) ` (operatingSystem=Windows Vista*)(operatingsystem=Windows 2000 Server) ` (operatingsystem=Windows Server*)))' If not, how else can I filter out the pwdLastSet filter? Should I just do it after in a pipe? i.e.: $StComps = Get-QADComputer -SizeLimit 0 -IncludeAllProperties -SearchRoot ` 'DC=MY,DC=DOMAIN,DC=LOCAL' -LdapFilter '(&(objectcategory=computer) ` (|(operatingsystem=Windows2000 Professional)(operatingSystem=Windows XP*) ` (operatingSystem=Windows7*)(operatingSystem=Windows Vista*) ` (operatingsystem=Windows 2000 Server)(operatingsystem=Windows Server*)))' ` | Where {$_.pwdLastSet -gt $ft} or even | Where {$_.LastLogonTimeStamp -gt $ft} I know this is going to be slower, but if I have to, I'll go this route. Also, if anyone know's off the top how to time how long a code snippet would take to run, that hint would be greatly appreciated =) ktxbye Thanks, -dboftlp

    Read the article

  • Get-QADComputer -LdapFilter & NOT operator

    - by dboftlp
    I'm having issues excluding an OU from my LDAP filter $DaysAgo = (Get-Date).AddDays(-31) $ft = $DaysAgo.ToFileTime() Get-QADComputer -SizeLimit 0 -IncludeAllProperties -SearchRoot 'DC=My,DC=Domain,DC=Local' -LdapFilter "(&(objectcategory=computer)(lastLogonTimeStamp<=$ft) (!(ou:dn:=DisabledPCs))(|(operatingsystem=Windows 2000 Professional) (operatingSystem=Windows XP*)(operatingSystem=Windows 7*) (operatingSystem=Windows Vista*)(operatingsystem=Windows 2000 Server) (operatingsystem=Windows Server*)))" I'm looking to query for all Windows OS systems that haven't logged in to AD for more than 31 days & that are not already in the OU "DisabledPCs", which is where I'll be moving them to. When I run it now, I'm getting all the systems I'm looking for, including those in the "DisabledPCs" OU... I've tried several variations including: (&(!(ou:dn:=DisabledPCs))) As well as putting it in different locations in the filter (not that I thought it would make a difference, but I obviously don't know that...) Thanks in advance for any help, -dboftlp

    Read the article

1