
Originally Posted by
FN-GM
I would like it so it checks if the computer is in a group and if it is then check if a file exists on the local machine if it doesn't then run the installer.
We have a .vbs login script to assign printers by OU of the user or machine, if that's any use to get you started:
Code:
Option Explicit
on error resume next
Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer, user
Set objNetwork = CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName
strComputerDN = objSysInfo.computerName
' Bind to the user and computer objects with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
Set objComputer = GetObject("LDAP://" & strComputerDN)
' Not quite sure why this is in a loop - maybe you just have to wait for Windows to get back to you?
Do While User = ""
User = lcase(objNetwork.UserName)
Loop
if InStr(strComputerDN, "OU=Staff Room") then
Run command goes here.
end if