SPO Powershell commands
$requests = Get-SPOTenantServicePrincipalPermissionRequests $requestToApprove = $requests | ? { $_.Resource -eq 'Office 365 SharePoint Online' -and $_.Scope -eq 'MyFiles.Read' } | Select-Object -First 1 if ($requestToApprove -ne $null) { Approve-SPOTenantServicePrincipalPermissionRequest -RequestId $requestToApprove.Id }
Approve-SPOTenantServicePrincipalPermissionGrant -Resource "Microsoft Graph" -Scope "Mail.Read"
Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential admin@contoso.com
1. Get Sharepoint Site ID in browser
https://0wjd6.sharepoint.com/_api/site/id
2. Find the ListId
You can find the ListId by navigating to the SharePoint list, and then copying the URL, and finding the ID.
To find the ListId
- Open SharePoint, and navigate to the list that contains your workflow.
- Click Edit this list, and then click List in the ribbon.
- Click List Settings.
- Copy the URL, and find the text after List=.
- Remove "%7B" from the front of the list.
- Remove "%7D" from the end of the list.
- Change %2 to a hyphen. This will change the following string:
%7B9D5F2138%2DC9E6%2D4473%2DA094%2DD7F4284C0388%7D
to
9D5F2138-C9E6-4473-A094-D7F4284C0388.
3. Get Sharepoint List Columns internal name
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration Parameters
$SiteURL="https://ohsdev.za.deloitte.com/"
$ListName= "Check%20Sheet%20New"
#Get the List
$List = (Get-SPWeb $SiteURL).Lists.TryGetList($ListName)
Write-Host "Field Name | Internal Name | Type"
Write-Host "------------------------------------"
#Loop through each field in the list and get the Field Title, Internal Name and Type
ForEach ($Field in $List.Fields)
{
Write-Host $Field.Title"|"$Field.internalName"|"$Field.Type
}
Comments
Post a Comment