• Remote activation of Windows Server Licensing via PowerShell (sort of)

    Commentated script providing a means of batch activating Virtual Machines and Physical servers using PowerShell and SCHTASKS.exe, circumventing the limitations of Invoke-Command when calling SLMGR.vbs. This script could easily be extended to work with other data-sources (Active Directory) or Hypervisors (vSphere via PowerCLI)

    [Read More...]
  • Cloning an existing Security Group using Active Directory Powershell

    Yesterday I came across a recurring scenario where a distribution group existed for a user set, but no security group. As we needed a security group for publishing an application to this user-set via our App-V management servers, I was driven to develop a quick AD single PoSH single liner (not single pipeline, sadly). It copies all the user object members of one group into another. Here it is!

    $userstoclone = Get-ADGroup -filter {Name -like “Source Group”} | Get-ADGroupMember | Where-Object {$_.objectClass -eq “user”};ForEach ($user in $userstoclone){Add-ADGroupMember –Identity (Get-ADGroup -filter {Name -like “Target Group”}) -Members $user}

    It wouldn’t take a world of imagination to change the filters so it could copy computer objects, group objects, recurse somewhat deeper etc.

    Enjoy!