Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Get-ADPrincipalGroupMembership and Get-ADGroup Internal Error

$
0
0

These are mainly AD issues not PowerShell issues.

First off – and this may seem like I’m splitting hairs – but the PowerShell team aren’t responsible for the AD cmdlets. They are produced by the AD team. What version of Windows are you using for your domain controllers? If you were running Windows 2008 R2 and for instance and upgraded PowerShell to v3 the AD cmdlets wouldn’t be changed because they aren’t part of the core PowerShell engine.

When I tried to create a group called Test/Group in AD Users and Computers I was told / is an illegal character and I was offered the chance to replace the / by a _ I got a similar error in New-Adgroup.
PS> New-ADGroup -Name ‘Test/Group’ -Path ‘ou=All groups,dc=manticore,dc=org’ -SamAccountName ‘Test/Group’ -GroupCategory
Security -GroupScope Global
New-ADGroup : The name provided is not a properly formed account name

if I was you I’d seriously consider renaming the groups to remove the /. Its going to save you a lot of effort over time.

I created a group with a different name and samAccountName and tried using Get-ADGroup

PS> New-ADGroup -Name ‘FunnyTestGroup’ -Path ‘ou=All groups,dc=manticore,dc=org’ -GroupCategory Security -GroupScope Gl
obal -SamAccountName ‘AnyOldName’
PS> Get-ADGroup -Identity ‘Funnytestgroup’
Get-ADGroup : Cannot find an object with identity: ‘Funnytestgroup’ under: ‘DC=Manticore,DC=org’.
At line:1 char:1
+ Get-ADGroup -Identity ‘Funnytestgroup’

The problem is that the identity parameter only accepts values representing
samAccountName
distinguished name
GUID
SID

In this case none of those were supplied. However:
Get-ADGroup -Filter {Name -eq ‘Funnytestgroup’}

will work for you.

Again I would recommend keeping the samAccountName the same as the group name for ease of administration


Viewing all articles
Browse latest Browse all 13067

Trending Articles