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.
Function SID2UPN(str_IN_SID)
Dim strNormalSID, ADuser
strNormalSID = makeSIDnormal(str_IN_SID)
Set ADuser = GetObject("LDAP://<SID="& strNormalSID & ">")
SID2UPN = ADuser.userPrincipalName
End Function
Function makeSIDnormal(mySID)
Dim objregEx,replace
replace=""
Set objregEx = New RegExp
objregEx.Global = True
objregEx.Pattern = "(%|{|})"
objregEx.IgnoreCase = True
makeSIDnormal = objregEx.Replace(mySID, replace)
End Function
Set ADConnection = CreateObject("ADODB.Connection")
Set ADCommand.ActiveConnection = ADConnection
ADCommand.CommandText = "Select Name,userPrincipalName,givenName,sn,sAMAccountName,ADsPath,mail,pwdLastSet from 'LDAP://<distinguished name>' Where objectCategory='user' AND userPrincipalName='<UPN>'"
ADCommand.Properties("Page Size") = 1000
ADCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set ADrs = ADCommand.Execute