title: Primary Group ID Powershell Variable
body: <p>I'm trying to modify my Powershell script to change/replace an Active Directory users Primary Group.  Currently, the PrimaryGroupID is using a hardcoded number but we'd rather have something more... portable.  Is there a way to do a lookup for the specific group by name and input that as a variable into my code below - replacing the "<em>2131</em>" primary group ID?</p>
  
  <pre><code># Set named users primary group to "Disabled Users"
   Set-ADUser -Identity $User1 -Replace @{PrimaryGroupID="2131"}
  </code></pre>
  
  <p>I know I'm likely overthinking things and the answer is right in front of me but lack of sleep (new baby) and staring at code all week has me fried.</p>
  
  <p>Thanx...</p>