Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Wednesday, November 2, 2011

How long can a GPO name be?

This was a unique one.  I created a GPO with the longest name possible.  Instead of counting I switched to PowerShell.

 

Open PowerShell on the Domain Controller.

Type Import-Module Group Policy

The name I used was a repeating 0123456789 to help make locating it easier.  I then used the following PowerShell line to count the characters of the name for me.

((Get-GPO –all | Where {$_.DisplayName –like “01234*”}).DisplayName).Length

The returned value was 255.

No comments: