• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Add notes to multple AD groups

Hi EE..

I want to add a note to a set of groups but .. first is below correct ? and how would I add two notes , in separate lines ?
So for instance .. I want it to appear as below in the Group notes .

Approver: Person1
Approver: Person2


GC C:\Powershell\groups.txt | % {
$info = "Approver: Person1"
Set-ADGroup $_ -replace @{info=$info}
}
0
MilesLogan
Asked:
MilesLogan
  • 3
  • 2
1 Solution
 
footechCommented:
Haven't tested, but probably like this.
GC C:\Powershell\groups.txt | % {
$info = "Approver: Person1`nApprover: Person2"
Set-ADGroup $_ -replace @{info=$info}
} 

Open in new window

Let me know if it doesn't work.
0
 
MilesLoganAuthor Commented:
Hi Subsun ..

It does add the note but on one line .. not on two separate lines like I would like it to .

Approver: Person1
Approver: Person2
0
 
footechCommented:
It's footech.  :)
I tested a minor change which works.
GC C:\Powershell\groups.txt | % {
$info = "Approver: Person1`r`nApprover: Person2"
Set-ADGroup $_ -replace @{info=$info}
}

Open in new window

0
 
MilesLoganAuthor Commented:
My bad footech ..your awesome !
0
 
MilesLoganAuthor Commented:
Perfect .. thanks footech !
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now