I’m a beginner to powershell. I need some help to better understanding the object input type.
Trying to create basic two line cmdlet for adding membership to new user and keep getting error. I know I’m doing something wrong, I just want some to help me point right direction what to look for these type of issues.
Here is my cmdlets.
creating a variable to get the user ID from Text.
$userid=Get-Content C:\PowershellTraining\Production\usercreation.txt #now to add the user membership Add-ADPrincipalGroupMembership -Identity $userid -MemberOf Group1, Group2, Group3, Group4
I know get-content is string object and -identity only accepts AD principal type. So that’s definitely the reason but how I get this to work. What should be looking for when I’m writing command like this and where.
please let me know