How many objects will be synchronized to the cloud?


 

Import-Module ActiveDirectory
Get-ADObject -Filter {((objectClass -eq 'user') -and (objectClass -ne 'computer')) -or (objectClass -eq 'contact') -or (objectClass -eq 'group')} | Measure-Object | Format-List Count

 

 

Comments (1)

  1. good info Euclides, Thanks!
    but FYI the only way i got it to run without errors was by changing the quote ‘ for double quotes “, like this:

    Get-ADObject -Filter {((objectClass -eq “user”) -and (ObjectClass -ne “computer”)) -or (objectClass -eq “contact”) -or (objectClass -eq “group”)} | Measure-Object | Format-List Count

    otherwise i was getting:

    Get-ADObject : Error parsing query: ‘((objectClass -eq ‘user’) -and (objectClass -ne ‘computer’)) -or (objectClass -eq ‘contact’) -or (objectClass -eq ‘group’)’ Error Message: ‘syntax error’ at position: ’19’.
    At line:1 char:1
    + Get-ADObject -Filter {((objectClass -eq ‘user’) -and (objectClass -ne …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ParserError: (:) [Get-ADObject], ADFilterParsingException
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADFilterParsingException,Microsoft.ActiveDirectory.Management.Commands.GetADObject

Skip to main content