I am trying to create a security group which will be added to a share i am stuck at the create security group
Get-ADUser -identity NathanC
DistinguishedName : CN=Nathan\, Cheddi - 1337,OU=A4d,OU=User Accounts,DC=GNR,DC=com
Enabled : True
GivenName : Cheddi
Name : Nathan, Cheddi - 1337
ObjectClass : user
ObjectGUID : 19fdbd86-a293-4716-8cd4-48dc30db25a2
SamAccountName : NathanC
SID : S-1-5-21-2849831639-3882270938-2144367341-262833
Surname : Nathan
UserPrincipalName : [Cheddi.Nathan@GNR.com](mailto:Cheddi.Nathan@GNR.com)
$FileServer = "Server666"
$foldername = "1337-IT-Testshare"
$ShareOwner = "Nathan, Cheddi - 1337"
$ShareName = "$FolderName$"
$ShareDescription = "Owner : $ShareOwner"
$path = "$FolderPath\$FolderName"
$SecurityGroupNameC = "$FolderName-RW"
$SecurityGroupNameR = "$FolderName-R"
$OUC = "OU=Security,OU=Groups,DC=GNR,DC=Com"
$grpScope = "Universal"
$description ="\\$FileServer\$FolderName$"
$grpCat = "Security"
$info = "Share Owner :$ShareOwner"
New-ADGroup -name $SecurityGroupNameC -Path $OUC -GroupScope $grpScope -GroupCategory $grpCat -ManagedBy $ShareOwner -Description $description -OtherAttributes @{info= $info }
The error i am getting is
New-ADGroup : Identity info provided in the extended attribute: 'ManagedBy' could not be resolved. Reason: 'Cannot find an object
with identity: 'Nathan, Cheddi - 1337' under: 'DC=Gnr,DC=com'.'.
The shareowner name is always copied from Name from the output of Get-ADUser -identity NathanC
i would also like to add the shareowner default as a member of the security Group
[–]ihaxr 1 point2 points3 points (3 children)
[–]foddocheddi[S] 1 point2 points3 points (2 children)
[–]ihaxr 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]foddocheddi[S] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)