?
Solved

Can anyone help me getting this script "sidmap.wsf" its part of the resource kit of OCS.

Posted on 2010-03-26
4
Medium Priority
?
1,337 Views
Last Modified: 2013-11-29
Hi,

Can anyone help me getting this script "sidmap.wsf" its part of the resource kit of OCS.
I am not able to extract it because of the processor mismatch.

OCS resource kit file

REgards
Sharath
0
Comment
Question by:bsharath
  • 2
  • 2
4 Comments
 
LVL 33

Accepted Solution

by:
Busbar earned 2000 total points
ID: 28706618
if you want only the wsf file then below its content, if you want the hall bunch of script send to me your email so i can send it to you:
---------------
<?xml version="1.0" ?>
<package>
    <job id="Main" prompt="no">
    <?job debug="true" error="true" ?>
        <runtime>
            <description>
This script copies the SID value from the AD attribute, msExchMasterAccountSid,
to the attribute, msRTCSIP-OriginatorSid, for every disabled user in the forest
that is SIP enabled.
            </description>
            <named
                name="OU"
                helpstring="The Active Directory DN of the organizational unit to search under"
                many="false"
                type="string"
                required="false"
            />
            <named
                name="query"
                helpstring="Generates a list of disabled users that are mailbox and SIP enabled and associated with an external account"
                type="simple"
                required="false"
            />
            <named
                name="logfile"
                helpstring="Text file used to log the output."
                type="string"
                required="false"
            />
        </runtime>
<script id="VBScript_Block" language="VBScript">
    <![CDATA[
' Initialize variables
const ForWriting = 2
intCount = 0
bQuery = False

On Error Resume Next 'Force continuation on errors when initializing globals

' Retrieve command-line arguments

' Check whether an OU is provided.
if WScript.Arguments.Named.Exists("OU") then
        strNamingContext = "LDAP://" & WScript.Arguments.Named("OU")
      else
          Set objRootDSE = GetObject("LDAP://rootDSE")
            strNamingContext = "LDAP://" & objRootDSE.Get("defaultNamingContext")
end if

' Check whether the user only wants to query the AD.
if WScript.Arguments.Named.Exists("query") then
    ' Query only all disabled users that are mailbox and SIP enabled.
    ' set.
    bQuery = True
end if

' Check whether logging to a file is required.
if WScript.Arguments.Named.Exists("logfile") then
    strLogFile = WScript.Arguments.Named("logfile")
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set objLogFile = fso.OpenTextFile(strLogFile, ForWriting, True)
    objLogFile.WriteLine("List of disabled users associated with an external account and SIP enabled:")
end if

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open
 
' Create connection to AD.
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection

' Define AD query.
' Search for disabled user accounts that are SIP enabled and mailbox enabled.
objCommand.CommandText = _
    "<" & strNamingContext & ">;" & _
        "(&(objectCategory=person)(objectClass=user)(msRTCSIP-UserEnabled=TRUE)(msExchMasterAccountSid=*)(userAccountControl:1.2.840.113556.1.4.803:=2));" & _
            "ADsPath,cn,msRTCSIP-PrimaryUserAddress,msExchMasterAccountSid,msRTCSIP-OriginatorSid;subtree"

' Disable caching to reduce memory consumption for very large result sets.
objCommand.Properties("Cache Results") = FALSE
' Define the maximum page size.
objCommand.Properties("Page Size") = 1000
 
' Execute query.
Set objRecordSet = objCommand.Execute
If Err.Number <> 0 Then
    WScript.Echo("Failed to query Active Directory " & strNamingContext)
    WScript.Quit(Err.Number)
end if
 
While Not objRecordset.EOF
    intCount = intCount + 1
    if IsObject(objLogFile) then
       objLogFile.WriteLine(objRecordset.Fields("cn").Value)
    else
        WScript.Echo(objRecordset.Fields("cn").Value)
    end if
   
    if bQuery = False then
        ' Set the msRTCSIP-OriginatorSid attribute.
        Set objContact = GetObject(objRecordset.Fields("ADsPath"))
        strExchSid = objRecordset.Fields("msExchMasterAccountSid").Value

        objContact.Put "msRTCSIP-OriginatorSid", strExchSid
        objContact.SetInfo

        If Err.Number <> 0 Then
            if IsObject(objLogFile) then
               objLogFile.WriteLine("Failed to set msRTCSIP-OriginatorSid attribute " & _
                    Err.Number)
            else
                WScript.Echo("Failed to set msRTCSIP-OriginatorSid attribute " & _
                    Err.Number)
            end if
        end if
    end if

    WScript.Echo()
    objRecordSet.MoveNext
Wend
 
WScript.Echo intCount & " disabled users."

if IsObject(objLogFile) then
    objLogFile.WriteLine(vbNewLine & intCount & " disabled users.")
    objLogFile.Close
end if
objConnection.Close
    ]]>
</script>
    </job>
</package>
--------------------
copy it to a file and rename it to sidmap.wsf
0
 
LVL 11

Author Comment

by:bsharath
ID: 28706857
Thanks
Any idea what i need to change in the script
0
 
LVL 33

Expert Comment

by:Busbar
ID: 28709584
0
 
LVL 11

Author Comment

by:bsharath
ID: 28709910
Thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question