how can get all users details from single forest and its child domains

Hi

While trying to get all users details from below script getting below error:

I  understand that error is valid but I am trying to get all users from forest having 4 child domain , user properties..

Please add or guide me on this

Import-Module ActiveDirectory
$forest= (Get-ADForest).domains
$Outfile = "D:\script\SIPuserdetails.csv"
Get-ADUser -Filter {(msRTCSIP-UserEnabled -eq $False) -and (enabled -eq $True)} -Server $forest -Properties * | select name,samaccountname,msRTCSIP-PrimaryUserAddress

Error###########

PS D:\temp> .\SearchSIPusers.ps1
Get-ADUser : Cannot convert 'Microsoft.ActiveDirectory.Management.ADPropertyVal
ueCollection' to the type 'System.String' required by parameter 'Server'. Speci
fied method is not supported.
At D:\temp\SearchSIPusers.ps1:19 char:88
+ Get-ADUser -Filter {(msRTCSIP-UserEnabled -eq $False) -and (enabled -eq $True
)} -Server <<<<  $forest -Properties * | select name,samaccountname,msRTCSIP-Pr
imaryUserAddress
    + CategoryInfo          : InvalidArgument: (:) [Get-ADUser], ParameterBind
   ingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.
   Management.Commands.GetADUser



  • Edited by Mr. Raj Tuesday, April 21, 2015 3:32 PM
April 21st, 2015 3:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics