locked
PS script to detect Windows version in GPO logon RRS feed

  • Question

  • I've been looking for a way to exclude Windows 7 machines from a GPO logon script that substitutes a local drive letter on our PCs.  The Group Policy Management Editor has a tab for PowerShell scripts and I'm thinking I might be able to choose from 'For this GPO, run scripts in the following order - Run Windows Powershell Scripts Last' to undo the original script's commands specifically for Win 7 PCs.

    I've never written a PS script before so I'm researching how to do this, but if anyone has any suggestion for what I imagine would be a pretty simple script, I'd appreciate it :) 

    The original script is a .cmd file

    @echo off
    cd\
    cls
    subst o: c:\Windows
    Exit

    Basically the PS script would need to undo this for W7 machines.

     

    Friday, May 31, 2013 1:48 PM

All replies