Compartilhar via


Finding list of SFU related attributes

It may happen that you need the list of all SFU related attributes in a domain. Although there is no in-built way to get the list, here is a small script which will traverse your domain and generate a list of all the attributes that are used by SFU. These attributes usually have a string "SFU" in their name. The following script will search for the attributes having string "SFU" and will generate the list. 

Copy the below script and save it in one of your domain controllers with .vbs extension, for example search_attributes.vbs . Now change the following line and put your domain name in the line :
strLDAPPath = "<LDAP://CN=Schema,CN=Configuration,DC=devendranis,DC=COM>"

Save the file and run it:
cscript search_attributes.vbs > listOfAttributes.txt

=========================================================================================================

Option Explicit
'On Error Resume Next

Dim Con
Dim Com
Dim Rec
Dim strCommand
Dim objUser
Dim strLDAPPath
Dim iCount
Dim strPath
Dim strAdspath
Dim objRootDSE

Set Con = CreateObject("ADODB.Connection")
Set Com = CreateObject("ADODB.Command")
Set Rec = CreateObject("ADODB.Recordset")

Con.Provider = "ADsDSOObject"
Con.Open

Set objRootDSE = GetObject(" LDAP://RootDSE ")

'Please put your domain name below
strLDAPPath = "<
LDAP://CN=Schema,CN=Configuration,DC=devendranis,DC=COM >"

strCommand = strLDAPPath & ";(&(lDAPDisplayName=*sfu*)(objectClass=attributeSchema));CN;subtree"

Com.CommandText = strCommand
Com.ActiveConnection = Con

Com.Properties("Page Size") = 1000

Set Rec = Com.Execute

Do until Rec.EOF
WScript.Echo "CN : " & Rec("CN")

WScript.Echo ""
Rec.MoveNext
Loop

Set Con = Nothing
Set Com = Nothing
Set Rec = Nothing

WScript.Echo "Done"

=========================================================================================================

Happy scripting!