windows server check active directory user code example Example: list ad groups in powershell: gpresult /V