Announcement

Collapse
No announcement yet.

Change Roaming Profile to local Profile

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change Roaming Profile to local Profile

    Dear All,

    I need your help in developing a VB script or Windows power shell to change the users roaming profile to local profile.
    can I find any help here?

    I have developed the following script, but I am not able to update the profilepath.


    On Error Resume Next

    Const ADS_SCOPE_SUBTREE = 2

    Set objConnection = CreateObject("ADODB.Connection")
    Set objCommand = CreateObject("ADODB.Command")
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"
    Set objCommand.ActiveConnection = objConnection


    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE


    objCommand.CommandText = _
    "SELECT profilePath FROM 'LDAP://ou=All Users,dc=acc,dc=aub,dc=edu,dc=lb' WHERE objectCategory='user'"
    Set objRecordSet = objCommand.Execute

    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
    objRecordSet.PutEx ADS_PROPERTY_CLEAR, "profilePath", 0
    objRecordSet.SetInfo
    objRecordSet.MoveNext
    Loop
    Last edited by sanvour; 21st November 2006, 13:11.
    Best regards,
    Mostafa Itani

    ** Remember to give credit where credit is due and leave reputation points where appropriate **
Working...
X