SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
  2. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
  3.  
  4. $UserName = ""
  5. $Password = ""
  6. $Url = ""
  7. $SecurePassword= ConvertTo-SecureString $Password –asplaintext –force
  8. $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,$SecurePassword)
  9.  
  10. $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($Url)
  11. $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,$SecurePassword)
  12. $clientContext.Credentials = $credentials
  13. $Web = $clientContext.Web
  14. $clientContext.Load($Web)
  15. $lists = $Web.Lists
  16. $clientContext.Load($lists);
  17. $list = $lists.GetByTitle("List Title")  
  18. $clientContext.Load($list)
  19. $clientContext.Load($list.Fields)
  20. $field= $list.Fields.GetByInternalNameOrTitle("Order");
  21. $clientContext.Load($field);
  22. $clientContext.ExecuteQuery();
  23. $field.SchemaXml = $field.SchemaXml.Replace("Hidden=""TRUE""","Hidden=""FALSE""");
  24. $clientContext.ExecuteQuery();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top