Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PS script to detect Windows version in GPO logon

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>