need help convert PS script to Quest Powershell script

I ran my ps script directly on the server is work well but for some reason when I import to the Active Role I got an error Term Get-ADUser is not recognized

hope someone could help me :-)

Get-ADUser -Filter * -SearchBase "DC=xxx,DC=xxx" -Properties * | Select-Object displayname,userprincipalname,AccountNotDelegated | Export-Csv -path C:\temp\UserAccountsensitiveCannotDelegated-TechnicalidAdminAccountsOU.csv

Parents
  • $Report = "$($env:USERPROFILE)\Desktop\Report-$(Get-Date -format "yyyyMMddHHmmss").csv"
    $SearchRoot = "CN=Active Directory"
    $SizeLimit = 0


         Get-QADUser `
              -SearchRoot $SearchRoot `
              -IncludedProperties SamAccountName,DisplayName,UserPrincipalName,UserAccountControl `
              -DontUseDefaultIncludedProperties `
              -SizeLimit $SizeLimit `
              -Proxy | `
         Select-Object `
              SamAccountName, `
              DisplayName, `
              UserPrincipalName, `
              @{
                   Name = "TrustedForDelegation"
                   Expression = {
                        ($_.UserAccountControl -band 0x80000) -ne 0
                   }
              },
              @{
                   Name = "NotTrustedForDelegation"
                   Expression = {
                        ($_.UserAccountControl -band 0x100000) -ne 0
                   }
              } | `
         Export-CSV -Path $Report -NoTypeInformation -NoClobber -Encoding UTF8

Reply
  • $Report = "$($env:USERPROFILE)\Desktop\Report-$(Get-Date -format "yyyyMMddHHmmss").csv"
    $SearchRoot = "CN=Active Directory"
    $SizeLimit = 0


         Get-QADUser `
              -SearchRoot $SearchRoot `
              -IncludedProperties SamAccountName,DisplayName,UserPrincipalName,UserAccountControl `
              -DontUseDefaultIncludedProperties `
              -SizeLimit $SizeLimit `
              -Proxy | `
         Select-Object `
              SamAccountName, `
              DisplayName, `
              UserPrincipalName, `
              @{
                   Name = "TrustedForDelegation"
                   Expression = {
                        ($_.UserAccountControl -band 0x80000) -ne 0
                   }
              },
              @{
                   Name = "NotTrustedForDelegation"
                   Expression = {
                        ($_.UserAccountControl -band 0x100000) -ne 0
                   }
              } | `
         Export-CSV -Path $Report -NoTypeInformation -NoClobber -Encoding UTF8

Children
No Data