I have been looking for a vbs that will add certain printers dependant on what group a user is in within active directory.
this would then need to be launched from the logon script.
I have found this code below but would like to know how to change it so it looks for multiple OU's within Active Directory and install multiple printers for some users.
Thanks for any help on this.
Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
Dim objWinntComp
Set objWinntComp = GetObject("WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer")
'MsgBox "WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer"
Dim strGroupToCheck
Dim strPrinter
strPrinter = "\\server\IT_Printer"
strGroupToCheck = "IT_Printer"
If IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = True Then
MsgBox "You are a member of " & strGroupToCheck & VbCrLf & "Mapping printer: " & strPrinter
objNetwork.AddWindowsPrinterConnection strPrinter
ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = False Then
MsgBox "You are NOT a member of " & strGroupToCheck
WScript.Quit
ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = "Error" Then
MsgBox "There was no group found called " & strGroupToCheck
WScript.Quit
End If
Function IsMemberOfGroup(strUserDomain, objComp, strGroup) 'the user is a member of a specified group
IsMemberOfGroup = False
Dim objGroup
On Error Resume Next
Set objGroup = GetObject("WinNT://" & strUserDomain & "/" & strGroup & ",group")
If Err.Number Then
IsMemberOfGroup = "Error"
Else
IsMemberOfGroup = objGroup.IsMember(objComp.ADsPath & "$")
End If
End Function
Depends on what you mean by "this data". Nvidia can show you quite a few of those as well in their performance overlay, and I guess they might've assumed that if anyone wants to see more, they'll just use Afterburner as the de facto standard.
As for real framerate vs framegen framerate, I don't think they exactly want you to know, given that their marketing has been strongly focused on hiding the real framerate and pretending the generated one is all that matters...
Yeah, but that never works out well. You can just give your power user more options and they'll be happy. Your new generation can just go with whatever you think is the best default.
It's cheaper to let their 3rd party sales people do more than supporting thousands in-house. Sucks for those who lost a job but these tech and entertainment companies overstaffed with the lockdown and the huge boost in demand they got when everyone was stuck at home.
Question
SoulDevil
Hi,
I have been looking for a vbs that will add certain printers dependant on what group a user is in within active directory.
this would then need to be launched from the logon script.
I have found this code below but would like to know how to change it so it looks for multiple OU's within Active Directory and install multiple printers for some users.
Thanks for any help on this.
Edited by SoulDevilLink to comment
https://www.neowin.net/forum/topic/742712-vbs-adding-printers-depending-on-ad-group/Share on other sites
0 answers to this question
Recommended Posts