Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 捕获不同的Sharepoint GUID_Xml_Powershell_Api_Sharepoint_Office365 - Fatal编程技术网

Xml 捕获不同的Sharepoint GUID

Xml 捕获不同的Sharepoint GUID,xml,powershell,api,sharepoint,office365,Xml,Powershell,Api,Sharepoint,Office365,我编写了一个程序,该程序正在映射我计算机上SP(O365)的特定列表。 为了实现这一点,我使用了不同的GUID(web、列表、站点) 我正在搜索捕获所有需要的guid,而不必自己动手。(_api/web在url之后) 你有什么想法吗?非常感谢 param( [string]$siteid='GUID', [string]$webid='GUID', [string]$URL='https://company.sharepoint.com/sites/group/', [string]$listi

我编写了一个程序,该程序正在映射我计算机上SP(O365)的特定列表。 为了实现这一点,我使用了不同的GUID(web、列表、站点)

我正在搜索捕获所有需要的guid,而不必自己动手。(_api/web在url之后)

你有什么想法吗?非常感谢

param(
[string]$siteid='GUID',
[string]$webid='GUID',
[string]$URL='https://company.sharepoint.com/sites/group/',
[string]$listid='GUID',
[string]$webtitle='company'
)

$rand = Get-Random -Maximum 10
sleep $rand
#Sleep is required, if the same script runs at the same time it'll mess up the configuration.
$Version = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseID | Select-Object ReleaseID
if($version.releaseID -lt 1709) { break }

$strFilter = “(&(objectCategory=User)(SAMAccountName=$Env:USERNAME))”
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = “Subtree”
$objSearcher.PropertiesToLoad.Add(“userprincipalname”) | Out-Null
$colResults = $objSearcher.FindAll

$UPN =  (Get-ItemProperty -Path “HKLM:\SYSTEM\ControlSet001\Control\CloudDomainJoin\JoinInfo\*”).UserEmail
$path = "C:\Users\$($env:username)\Lime Networks BV\Lime Networks - $($listtitle)"
if(Test-Path $path){
#DoNothing
} else {
start "odopen://sync/?siteId=$siteid&webId=$webid&listId=$listid&userEmail=$upn&webUrl=$URL&webtitle=$webtitle&listtitle=$listtitle" 
} 

导航到所需的SharePoint列表。 然后转到您的列表设置

将浏览器地址栏中的Url复制到记事本中。它将看起来像: ()

从“List=”返回到“https”,删除第一个百分比字符之前的所有内容。 将“%7B”更改为“{” 将所有“%2D”更改为“-” 技术“%7D”到“}” 您现在只剩下Id:

{26534EF9-AB3A-46E0-AE56-EFF168BE562F} 这就是你的GUID