PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Scripting in 2003 Active Directory
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Scripting in 2003 Active Directory

Réponse
 
LinkBack Outils de la discussion
Vieux 04/10/2007, 10h51   #1
gram
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Scripting in 2003 Active Directory

We need a script to change about 100 users profile paths in 2003 AD, instead
of doing it manually.

The only change is the servername, rest of path is ok.

can anyone point me to a website or to a script that will do this?

Regards



  Réponse avec citation
Vieux 05/10/2007, 23h15   #2
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Scripting in 2003 Active Directory

gram wrote:

> We need a script to change about 100 users profile paths in 2003 AD,
> instead
> of doing it manually.
>
> The only change is the servername, rest of path is ok.
>
> can anyone point me to a website or to a script that will do this?
>


I have an example VBScript program to change profilePath for users in bulk
from a spreadsheet linked here:

http://www.rlmueller.net/UpdateUserProfile.htm

The spreadsheet should have user Distinguished Names in the first column and
the new profilePath in the second column. There is also a link above to a
program to create the spreadsheet with user Distinguished Names in the first
column. You can modify that program, CreateUserList3.vbs, to add the
existing value of profilePath to the second column. To do this add the
additional attribute name to the comma delimited list in the query
statement. The existing statement is:
===========
strQuery = "<LDAP://" & strDNSDomain & ">;" & strFilter _
& ";distinguishedName;subtree"
============
This should be revised to:
=======
strQuery = "<LDAP://" & strDNSDomain & ">;" & strFilter _
& ";distinguishedName,profilePath;subtree"
=========
Then in the loop where the recordset is enumerated, add statements to write
profilePath in the second column of the spreadsheet. The complete loop would
be:
=============
Dim strProfile

Do Until adoRecordset.EOF
strDN = adoRecordset.Fields("distinguishedName").Value
' Escape any forward slash characters, "/", with the backslash
' escape character. All other characters that should be escaped are.
strDN = Replace(strDN, "/", "\/")
objSheet.Cells(k, 1).Value = strDN
strProfile = adoRecordset.Fields("profilePath").Value
objSheet.Cells(k, 2).Value = strProfile
k = k + 1
adoRecordset.MoveNext
Loop
============
Note I also added a "Dim" statement to declare the new variable
"strProfile". This is needed because the script uses "Option Explicit".

Using a spreadsheet allows you to manipulate the values any way you wish.
Replacing the server name throughout should be easy. You can also delete
rows for users that should not be modified.

The program CreateUserList3.vbs documents all users in the domain. If your
users are just in one OU, change the base of the query in that program to
specify the Distinguished Name of the domain. Instead of strDNSDomain above,
use the Distinguished Name of your OU. Then only users in the OU are
documented in the spreadsheet.

Once the spreadsheet is complete, run UpdateUserProfile.vbs linked above.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


  Réponse avec citation
Vieux 11/10/2007, 16h42   #3
David Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Scripting in 2003 Active Directory

Hello gram,

There's a utility called ADModify that will do bulk modifications of most
of the AD fields.
http://technet.microsoft.com/en-us/l.../aa996216.aspx



> We need a script to change about 100 users profile paths in 2003 AD,
> instead of doing it manually.
>
> The only change is the servername, rest of path is ok.
>
> can anyone point me to a website or to a script that will do this?
>
> Regards
>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h04.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 5,06221 seconds with 11 queries