Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
str_SID = "S-xxxx-xxxx..."
strDom = "ICFUC"
strGrp = "GroupName"
Call fnEnumGroups(strDom, strGrp, str_SID)
Function fnEnumGroups(strDomain, strGroupName, strSID_2_Search)
Dim objGrp, objUser, intUserSID
Set objGrp = GetObject("WinNT://" & strDomain & "/" & strGroupName & ",group")
objGrp.Filter = Array("user")
For Each objUser In objGrp
objUser.GetInfo
intUserSID = fnGet_HexString(objUser.Get("objectSID"))
If intUserSID = strSID_2_Search Then
Wscript.Echo intUserSID
Wscript.Echo objUser.Name 'or whatever attribute you may need....
Wscript.Echo ""
Exit Function
End if
Next
Wscript.Echo "Nothing found on : " & strSID_2_Search & " in " & strDomain & "/" & strGroupName
Set objGrp = Nothing
End Function
Function fnGet_HexString(intSID)
Dim strRet, i, b
strRet = ""
For i = 0 to Ubound(intSID)
b = hex(ascb(midb(intSID,i+1,1)))
If( len(b) = 1 ) then b = "0" & b
strRet = strRet & b
Next
fnGet_HexString = fnHexStrToDecStr(strRet)
End Function
Function fnHexStrToDecStr(strSid)
Dim arrbytSid, lngTemp, j
ReDim arrbytSid(Len(strSid)/2 - 1)
For j = 0 To UBound(arrbytSid)
arrbytSid(j) = CInt("&H" & Mid(strSid, 2*j + 1, 2))
Next
fnHexStrToDecStr = "S-" & arrbytSid(0) & "-" _
& arrbytSid(1) & "-" & arrbytSid(8)
lngTemp = arrbytSid(15)
lngTemp = lngTemp * 256 + arrbytSid(14)
lngTemp = lngTemp * 256 + arrbytSid(13)
lngTemp = lngTemp * 256 + arrbytSid(12)
fnHexStrToDecStr = fnHexStrToDecStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(19)
lngTemp = lngTemp * 256 + arrbytSid(18)
lngTemp = lngTemp * 256 + arrbytSid(17)
lngTemp = lngTemp * 256 + arrbytSid(16)
fnHexStrToDecStr = fnHexStrToDecStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(23)
lngTemp = lngTemp * 256 + arrbytSid(22)
lngTemp = lngTemp * 256 + arrbytSid(21)
lngTemp = lngTemp * 256 + arrbytSid(20)
fnHexStrToDecStr = fnHexStrToDecStr & "-" & CStr(lngTemp)
lngTemp = arrbytSid(25)
lngTemp = lngTemp * 256 + arrbytSid(24)
fnHexStrToDecStr = fnHexStrToDecStr & "-" & CStr(lngTemp)
End Function