Question on Set-UserInfoDetails

Oct 7, 2009 at 7:14 PM

The Set-WSS-Contact-List-From-ActiveDirectory script has a variable called "Set-UserInfoDetails" that takes three arguments: the contact list url, name, and LDAP string, like this:

Set-UserInfoDetails "http://myWebApplication/sites/MySiteCollection" "My Contact ListName" "LDAP://OU=MYActiveDirectoryOU,DC=MySubDomain,DC=MyDomain,DC=COM"

What is the contact list, in this instance? Is is the same as the hidden WSS view that shows People and Groups with syntax http://your.domain.com/_layouts/people.aspx

Or is the contact list something else entirely?

 

Coordinator
Oct 7, 2009 at 9:38 PM

Hi,

The script you talk about is dedicated to :

  • Load Active Directory Users in a SharePoint Contact list (basic Contact SharePoint List)

You only have to adapt the call you wrote with your case :

  • SharePoint Site address (SPWeb)
  • Name of your contact list
  • Active Directory Connexion String (with your Organization Unit if you have one)

I hope that will help you

Fabrice

Oct 7, 2009 at 9:53 PM

Fabrice,

I think my question is really: what do you mean by a "basic Contact SharePoint List"?  I need something that will update the WSS 3.0 User Information List, not a specific contact list. Will this tool do that?

 

Coordinator
Oct 7, 2009 at 10:04 PM

"Basic Contact list", in a SharePoint site :

 - Site Actions > Create > Contact (In Communication Group)

For the WSS 3.0 User Information List (People and Group part), you need to use the other Script :

 - Set-WSS-UserInfo-From-ActiveDirectory

The internal name of this People is "UserInfo"

Best regards

Fabrice

Oct 8, 2009 at 4:12 AM

Thanks, I had mixed up the code from the two scripts.

Nov 3, 2009 at 7:35 PM

 

Hi,

 

When i run the  Set-WSS-Contact-List-From-ActiveDirectory.ps1 file , i got the error,

 

For Ref : Please find the below error, i create same custom list with name  "My Contact ListName" and modified  url, domain etc... see the below code also

SAMAccountName
Contact list: bce9c3fd-0ada-43cf-8509-d810b7923ded - My Contact ListName
Exception calling "FindAll" with "0" argument(s): "There is no such object on the server.
"
At C:\Set-WSS-Contact-List-From-ActiveDirectory.ps1:60 char:36
+     $colResults = $objSearcher.FindAll( <<<< )
0  Users updated in Time:  00:00:03.2319275
PS C:\Documents and Settings\Administrator>

 

function StartProcess()
{
# Create the stopwatch
[System.Diagnostics.Stopwatch] $sw;
$sw = New-Object System.Diagnostics.StopWatch
$sw.Start()
cls

# Optional if you want to clean by code your contact list
#QuickCleanAllListItems "http://spd:4393/sites/home" "My Contact ListName"

Set-UserInfoDetails "http://spd:4393/sites/home" "My Contact ListName" "LDAP://OU=Users,DC=spd,DC=wss,DC=COM"

$sw.Stop()
# Write the compact output to the screen
write-host $GLOBAL:TotalUsersUpdated " Users updated in Time: ", $sw.Elapsed.ToString()

}

 

I am requirment same as whatever the users are in AD,it will migrated to WSS site ,  --its my requirment.

Any body knows please forward my mail id..  its very urgent ,,,,plz do the needfull

 

----Mansooor

Coordinator
Nov 3, 2009 at 9:51 PM

Hi Mansooor

Are you sure for the connexionstring value LDAP://OU=Users,DC=spd,DC=wss,DC=COM ?

Your domain name is "spd.wss.com" ?

Fabrice Romelard [MVP]

Nov 4, 2009 at 5:23 PM

Hi Fabric,

Thax ur reply ....

I can show you screenshot for ur refernece ,but  in this texteditor we can't attachemented any file.  How ?

 

 

 

Nov 5, 2009 at 7:32 AM

 

Hi Fabric ,

I able to get the all AD users with their profile [ lastname,firstname,department,company etc..] into the WSS site  using this  Set-WSS-Contact-List-From-ActiveDirectory.ps1 script file.

 

but when i select the United Kingdom as  Country/religion in Active Direcoty,it will show GB in the list , its showing wrong .  How to solve this, where i have to modified this line of code .

 

Please tel me anybody..i need this in my project.  ASAP.

-----Mansoor

 

 

Coordinator
Nov 10, 2009 at 1:53 PM
Hi Mansoor,
I checked that.
The reason is because the GB/UK country is a specific case.
  • The official name is United Kingdom and the official ISO code is not UK but GB
So when i load the contact list with the data from Active Directory, the data i received is from the AD column "c", which is the Country code and not the Country name.
I will not change that because UK is not the official ISO code but GB, as you can see here :
  • http://www.davros.org/misc/iso3166.html#existing
If you change that you could have some mistake with the mapping with other applications.
Sorry for that.
Best regards
Fabrice Romelard [MVP]
Nov 10, 2009 at 5:55 PM
Hi Fabrice,
 
thanks a lot for  ur greate  reply....
 
But Fabrice there are more  two issues for  same script. i.e
 
 
1.when I was delete user from AD , it should not shown  In contact list ,but it is showing,…i thing the deletion function is not their ?
 

2.  when I modify  the e-mail for user in AD ,it will not shown in  Contact List        --Even after I run the script
 
     If u delete the conatct list  execute the script it will show ,that means we have to delete the contact list again and again when we  modified  in AD .
 
3.if we modify in contact list it will not updated in AD. ?
 
 
Please fabric the above issues i have to resolve for my project. its very important for me.
 
Do the needfull.
 
-----Mansoor
2009/11/10 fabrice69 <notifications@codeplex.com>

From: fabrice69

Hi Mansoor,
I checked that.
The reason is because the GB/UK country is a specific case.
  • The official name is United Kingdom and the official ISO code is not UK but GB
So when i load the contact list with the data from Active Directory, the data i received is from the AD column "c", which is the Country code and not the Country name.
I will not change that because UK is not the official ISO code but GB, as you can see here :
If you change that you could have some mistake with the mapping with other applications.
Sorry for that.
Best regards
Fabrice Romelard [MVP]

Read the full discussion online.

To add a post to this discussion, reply to this email (SharePointPSScripts@discussions.codeplex.com)

To start a new discussion for this project, email SharePointPSScripts@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Nov 10, 2009 at 10:00 PM

Hi Mansoor,

The deletion case is true, this is the reason you can find in the first part of the script the complete deletion function.

For the Email address, i have to check that.

Fabrice Romelard [MVP]

Nov 11, 2009 at 11:29 AM

Hi Fabric,

I got one more issue,  In AD the  user Property  ' Office' ,i have to get this data from AD into Contact list. ,Even i modified the script  ,see the below code  in bold letters

<font face="Courier New" size="2" color="#800080"><font face="Courier New" size="2" color="#800080"><font face="Courier New" size="2" color="#800080">

$colProplist

</font></font></font><font face="Courier New" size="2" color="#800080"><font face="Courier New" size="2" color="#800080">

 

</font></font><font face="Courier New" size="2" color="#800080">

 

</font>

= "sn","givenname","name","samaccountname","objectsid","displayname","mail","Department","company","Office",..........

 

function

{

<font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff">

[

</font></font></font><font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff">

 

</font></font><font face="Courier New" size="2" color="#0000ff">

 

</font>

Set-Contact-Item([object]$ADUser, [object]$ContactList)bool]

$userInTheContactList = $false  

{ {

foreach($myItem in $ContactList.Items)

if($myItem["SAMAccountName"] -eq $ADUser.Properties.samaccountname)

$myItem["Title"] = [string]$ADUser.Properties.sn

$myItem["FirstName"] = [string]$ADUser.Properties.givenname

$myItem["FullName"] = [string]$ADUser.Properties.name

$myItem["JobTitle"] = [string]$ADUser.Properties.title

$myItem["Department"] = [string]$ADUser.Properties.department

$myItem["Office"] = [string]$ADUser.Properties.Office

....................

.......

 

 

 

 

 

 

<font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff">

if

</font></font></font><font face="Courier New" size="2" color="#0000ff"><font face="Courier New" size="2" color="#0000ff">

 

</font></font><font face="Courier New" size="2" color="#0000ff">

 

</font>

($userInTheContactList -ne $true)

{

<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font><font face="Courier New" size="2">

 

</font>

 

$MyNewItem = $ContactList.Items.Add()<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font>
<font face="Courier New" size="2">

 

</font>

 

$MyNewItem["SAMAccountName"] = [string]$ADUser.Properties.samaccountname<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font>
<font face="Courier New" size="2">

 

</font>

 

$MyNewItem["Title"] = [string]$ADUser.Properties.sn<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font>
<font face="Courier New" size="2">

 

</font>

 

$MyNewItem["Email"] = [string]$ADUser.Properties.mail<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font>
<font face="Courier New" size="2">

 

</font>

 

$myItem["Department"] = [string]$ADUser.Properties.department<font face="Courier New" size="2"><font face="Courier New" size="2">

 

</font></font>
<font face="Courier New" size="2">

 

</font>

 

$myItem["Office"] = [string]$ADUser.Properties.Office

 

I am not getting data ? Please do the needfull. And the yesteraday quries

you are saying Deletion case is true, Can u  please check once ..First run the script, you will get the all users in Contact list from AD ,after delete one user in AD ,then run the script ,it will showing ? this is issue. ? And

If u modified user data in conatact list ,it will not updated in AD. ? 

 

Please..?

 

 

 

 

Coordinator
Nov 11, 2009 at 2:56 PM

Hi,

To be honest, if you change all the original code by adding a lot of HTML stuff, i will not support that.

After that, The value loaded from the AD is pushed directly in the SharePoint list in my original script. The other point is the values loaded in the Contact list was based on the existing column from a standard contact list, and in this kind of list, nothing exists as "Office"

So if you want to load it from the AD, you need to create the column before.

Best regards

Fabrice Romelard [MVP]

Nov 13, 2009 at 6:05 AM
Hi Fabric,
 
Based on my client requirement i try to change the script code.
 
I already created the column ' Office' from add existing column in contact list, after  run the script, i am not getting the data from AD. In previous post ,i send the code for your reference you can check.
 
very great thank full to do  this help. its client requirement .Fabric

2009/11/11 fabrice69 <notifications@codeplex.com>

From: fabrice69

Hi,

To be honest, if you change all the original code by adding a lot of HTML stuff, i will not support that.

After that, The value loaded from the AD is pushed directly in the SharePoint list in my original script. The other point is the values loaded in the Contact list was based on the existing column from a standard contact list, and in this kind of list, nothing exists as "Office"

So if you want to load it from the AD, you need to create the column before.

Best regards

Fabrice Romelard [MVP]

Read the full discussion online.

To add a post to this discussion, reply to this email (SharePointPSScripts@discussions.codeplex.com)

To start a new discussion for this project, email SharePointPSScripts@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Nov 13, 2009 at 4:11 PM

Hi Mansoor,

Please to stop that.

You decided to modify my original script and in consequence, you have to assume the error you can have.

The original script works perfectly as you can find it on the site.

So i gave you now the last message about this script. The trouble is :

In this part :

= "sn","givenname","name","samaccountname","objectsid","displayname","mail","Department","company","Office",..........

"Office" has to be writen completely in lowercase :

= "sn","givenname","name","samaccountname","objectsid","displayname","mail","Department","company","office",..........

Have a good day, aand thanks to stop send me any mail.

Fabrice Romelard [MVP]

Nov 14, 2009 at 6:28 PM
Hi Fabrice,

I am very Sorry for sending mails again and again to you, i think i am disturb you ?

i am not saying that your script is wrong , its very very use full to others. i am very thank full to you to do such help for me in these days.

accroding to my project requirements i change the script ,thats it .!

i am again sorry to u, again i am sending last but one least query  .......... that is

Whatever modified user his user profile in contact list it will updated in AD. .for example 

i modifing  one of  user called 'user1'  his contact number in Contact list. when he click OK it will   updated contact list and  should updated in AD.

Is it your script fulfilled this requiement ,if no please send me the code .

I AM SAYING THIS IS LAST QUERY I AM SENDING YOU....................PLEASE DO THE NEEDFULL

Regards
Mansoor





2009/11/13 fabrice69 <notifications@codeplex.com>

From: fabrice69

Hi Mansoor,

Please to stop that.

You decided to modify my original script and in consequence, you have to assume the error you can have.

The original script works perfectly as you can find it on the site.

So i gave you now the last message about this script. The trouble is :

In this part :

= "sn","givenname","name","samaccountname","objectsid","displayname","mail","Department","company","Office",..........

"Office" has to be writen completely in lowercase :

= "sn","givenname","name","samaccountname","objectsid","displayname","mail","Department","company","office",..........

Have a good day, aand thanks to stop send me any mail.

Fabrice Romelard [MVP]

Read the full discussion online.

To add a post to this discussion, reply to this email (SharePointPSScripts@discussions.codeplex.com)

To start a new discussion for this project, email SharePointPSScripts@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Nov 16, 2009 at 11:26 AM

Hi Fabric,

Again you misunderstand me, i dont want to distrub you Fabric ?  you are sending twise  previous post. I got the solution eairler .Thanks for that

I send you my last requirment in the previous post , if u check it you will get otherwise see the below  ,Please its last query.

Whatever user  modified his user profiles in contact list it will updated in AD. .for example 

 
i modifing  one of  user his first name in Contact list. when he click OK it will   updated contact list and  should updated in AD.
I am telling you its last query,...........I am sorry for distrub U !
Coordinator
Nov 20, 2009 at 6:47 PM

Dear Mansoor,

You sell my script to your client and now you ask me to adapt it with their requests.

For me it's not acceptable, so if you want this kind of module, you have to work a few and write the needed code.

The second point is the Bidirectional sunc for user is not simple, and we use internal a software to do that :

 - Quest Account Management

So Please to stop this messages and send me mail

Thanks and have a good day.

Fabrice Romelard [MVP]