Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Active Directory Passing a variable fails

$
0
0

Hi,

I am running the following commands and getting the error below, this appears that either i'm passing the wrong information or im not declaring the variable correctly. Could someone inform me how to resolve my error.

Purpose of this script is to get a list of users in all groups in the domain.

$ADGroup = Get-ADGroup -LDAPFilter "(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=-2147483640))"
get-adgroupmember $ADGroup
Get-ADGroupMember : Cannot convert 'System.Object[]' to the type 'Microsoft.ActiveDirectory.Management.ADGroup' required by parameter 'Identity'. Specified me
thod is not supported.
At line:1 char:18
+ get-adgroupmember <<<<  $Groups
    + CategoryInfo          : InvalidArgument: (:) [Get-ADGroupMember], Parame
   terBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.
   Management.Commands.GetADGroupMember

Thanks in advanced for your help

Kind Regards,

Jason Field.


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>