使用powershell脚本下载用户配置文件的问题 [英] Issue with download user profile using powershell script

查看:119
本文介绍了使用powershell脚本下载用户配置文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用powershell脚本从sharepoint下载所有用户的数据。



以下语句已被用于获取所有用户的个人资料数据

$ profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ serviceContext);

$ profiles = $ profileManager.GetEnumerator()



然后我循环浏览$ profile以使用foreach循环读取每个用户的数据



foreach($ profile in $ profiles)

{

//读取数据

}



数据读取正确,但在数据类型为托管元数据且用户配置文件中存在多个值的情况下。在没有任何分离的情况下返回多个值。



例如。用户个人资料包含以下值



向我询问:测试1;测试2;测试3;



在脚本中返回的值将在下面没有任何分隔的情况下读取。



test 1测试2测试3



这是一个已知的问题吗?



有什么不同的方式我们在哪里可以通过一些分隔找到字段中的所有值。

I download data of all users from sharepoint using powershell script.

following statement has been used for getting profile data of all users
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()

then i loop through $profiles to read data of each user using foreach loop

foreach ($profile in $profiles)
{
//read data
}

data is read properly, but the in cases where data type is managed metadata and multiple values are present in users profile. multiple values are returned without any seperation.

eg. user profile contains values as below

Ask Me About: test 1; test 2; test 3;

values returned in script are read without any seperation in between as below.

test 1 test 2 test 3

is this a known issue?

is there any different way where we can find all values from field with some seperation.

推荐答案

profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager(
profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager(


serviceContext);
serviceContext);


profiles =
profiles =


这篇关于使用powershell脚本下载用户配置文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆