kwizcom banner advertisement

SharePoint Online: Set Site Column Properties using PowerShell

April 28, 2018    , , , ,
Requirement: Update Properties of a Site Column in SharePoint Online using PowerShell SharePoint Online: Set Site Column Properties using PowerShell CSOM #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Set-SPOSiteColumn($SiteURL,$ColumnName) { #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = $Cred #Check if the site column exists $Fields = $Ctx.web.Fields $Ctx.Load($Fields) $Ctx.ExecuteQuery() $FieldNames =
SharePoint Online: Set Site Column Properties using PowerShell SharePoint Online: Set Site Column Properties using PowerShell Reviewed by Salaudeen Rajack on April 28, 2018 Rating: 5

Disable "New Folder" in SharePoint Online Lists and Libraries

April 28, 2018    , , , ,
Requirement: Disable Folder Creation in SharePoint Online List or Document Library How to Prevent Folder Creation in SharePoint Online? To disable folder creation in SharePoint Online list or library, Go to List or Library Settings >> Click on "Advanced Settings" Under "Folders" section, set "No" for "Make 'New Folder' command available?" This disables "New Folder" option in SharePoint Online. PowerShell to Prevent Folder Creation in SharePoint Online? #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Disable-SPONewFolder($SiteURL,$ListName) { Try { #Get Credentials to connect $Cred= Get-Credential #Setup
Disable "New Folder" in SharePoint Online Lists and Libraries Disable "New Folder" in SharePoint Online Lists and Libraries Reviewed by Salaudeen Rajack on April 28, 2018 Rating: 5

HTML Field Security in SharePoint Online

April 28, 2018    , ,
Requirement: Configure HTML Field Security in SharePoint Online HTML Field Security in SharePoint Online: IFrames can lead to JavaScript injection attack, hence We've a security precaution in SharePoint Online to allow embed scripts only from trusted domains. If you try to add embed script from any other site, You'll get an error message: "Embedding content from this website isn't allowed, but your admin can change this setting. They will need to add 'www.videodomain.com' to the list of sites that are allowed." Add Trusted Domain to HTML Field Security List: SharePoint Online comes with a default list of web sites from which content can be displayed. You can add or remove sites in this list. To add a site to trusted sites list to embed IFrame, follow these steps: Go to Your SharePoint Online Site Collection >> Site Settings >> Click on "HTML Field Security" under Site Collection Administration  Set "Allow contributors
HTML Field Security in SharePoint Online HTML Field Security in SharePoint Online Reviewed by Salaudeen Rajack on April 28, 2018 Rating: 5

Find All OneDrive Site Collections in SharePoint Online using PowerShell

April 23, 2018    , , , ,
Requirement: Get a list of all OneDrive site collections from SharePoint Online. I was asked to get the list of all OneDrive sites to get the usage of OneDrive for Business in our Office 365 tenant. Its bit tricky to find all of your OneDrive site collections and here is how I achieved using Get-SPOSite cmdlet: Find All OneDrive Sites using SharePoint Online Management Shell: Here is the PowerShell script to get all OneDrive site collections in SharePoint Online. $AdminSiteURL="https://crescent-admin.sharepoint.com" #Get Credentials to connect to SharePoint Admin Center $Cred = Get-Credential #Connect to SharePoint Online Admin Center Connect-SPOService -Url $AdminSiteURL –credential $Cred #Get all Personal Site collections and export to a Text file Get-SPOSite -Template "SPSPERS" -limit ALL -includepersonalsite $True | Select URL, Owner | Format-table -autosize | Out-string -width 8096 | Out-file C:\temp\OneDriveSites.txt Just change the $AdminSiteURL t
Find All OneDrive Site Collections in SharePoint Online using PowerShell Find All OneDrive Site Collections in SharePoint Online using PowerShell Reviewed by Salaudeen Rajack on April 23, 2018 Rating: 5

How to Delete Office 365 Group using PowerShell?

April 22, 2018    ,
Requirement: Delete Office 365 Group using PowerShell How to Delete  Office 365 Group? As an admin, you can delete office 365 groups through Microsoft 365 admin center. Login to the Microsoft 365 Admin Center site: https://admin.microsoft.com Expand Groups and Click on Groups in the left navigation.  Select the Office 365 group to delete.  In the details pane, Click on "Delete" button and confirm delete group in Office 365. Delete Office 365 Group using PowerShell To delete Office 365 group using PowerShell, use Remove-UnifiedGroup cmdlet. Here is an example: #Get Credentials to connect $Credential = Get-Credential #Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $Credential -Authentication Basic -AllowRedirection #Import the session Import-PSSession $Session -DisableNameChecking -AllowClobber #Delete the Office 365 Group Remove-Unifi
How to Delete Office 365 Group using PowerShell? How to Delete Office 365 Group using PowerShell? Reviewed by Salaudeen Rajack on April 22, 2018 Rating: 5

Find All Office 365 Groups using PowerShell

April 21, 2018    ,
Requirement: Get Office 365 Groups using PowerShell How to Get Office 365 Groups in Admin Center? As an admin, you can get office 365 groups through Microsoft 365 admin center. Login to the Microsoft 365 Admin Center site: https://admin.microsoft.com Expand "Groups" and Click on "Groups" in the left navigation.  In the "View" drop-down, Select "Office 365". That list's all Office 365 groups to the page. Get Office 365 Group Details using PowerShell Use Get-UnifiedGroup cmdlet to get all Office 365 groups in Office 365. #Get Credentials to connect $Credential = Get-Credential #Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $Credential -Authentication Basic -AllowRedirection #Import the session Import-PSSession $Session -DisableNameChecking #Get all Office 365 Group Get-UnifiedGroup #Remove the sessio
Find All Office 365 Groups using PowerShell Find All Office 365 Groups using PowerShell Reviewed by Salaudeen Rajack on April 21, 2018 Rating: 5

Call REST API Methods in SharePoint Online from PowerShell

April 20, 2018    ,
Requirement: Call SharePoint Online REST API from PowerShell PowerShell to Call a REST API method in SharePoint Online: Here is how to call SharePoint Online REST API using PowerShell #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Get-SPOUserProfileProperty ($SiteURL, $UserID) { #Setup Credentials to connect $Cred = Get-Credential #Connect to Site $Context = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) $Context.ExecuteQuery() #Frame REST API URL $RequestUrl = "$($SiteUrl)/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accou
Call REST API Methods in SharePoint Online from PowerShell Call REST API Methods in SharePoint Online from PowerShell Reviewed by Salaudeen Rajack on April 20, 2018 Rating: 5

SharePoint Online: How to Disable Quick Launch Bar using PowerShell?

April 19, 2018    , ,
Requirement: Hide Quick Launch Bar in SharePoint Online How to Hide Quick Launch in SharePoint Online? To turn off quick launch in SharePoint Online, Go to: Site Settings >> Click on "Navigation Elements" under Look and Feel Un-Check "Enable Quick Launch" and Click OK. This removes quick launch in SharePoint Online. SharePoint Online: Disable Quick Launch using PowerShell: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Config Variable $SiteURL="https://crescenttech.sharepoint.com/sites/Marketing" #Setup Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credential
SharePoint Online: How to Disable Quick Launch Bar using PowerShell? SharePoint Online: How to Disable Quick Launch Bar using PowerShell? Reviewed by Salaudeen Rajack on April 19, 2018 Rating: 5

SharePoint Online: PowerShell to Get List Permissions

April 19, 2018    , , , ,
Requirement: Get List Permissions in SharePoint Online using PowerShell How to Get List Permissions in SharePoint Online? To view permissions applied to SharePoint Online list, follow these steps: Navigate to your SharePoint Online List >> Click on Settings Gear >> List Settings On List Settings page, Click on "Permissions on this List" link This page gets you all permissions on the particular list. SharePoint Online PowerShell to Get List Permissions  Here is the PowerShell to get list permissions and export to CSV in SharePoint Online #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Function to Get List Permissions Function Get-SPOListPermission([String]$SiteURL, [String]$ListName)
SharePoint Online: PowerShell to Get List Permissions SharePoint Online: PowerShell to Get List Permissions Reviewed by Salaudeen Rajack on April 19, 2018 Rating: 5

SharePoint Online: Clone User Group Memberships using PowerShell

April 19, 2018    , , , ,
Requirement: Clone a user's group permissions to another user in a SharePoint Online Site. PowerShell to Clone User's Group Memberships in SharePoint Online: It's a common real world scenario that when someone leaves the organization and somebody else takes that role they want the same permissions! While the requirement sounds simple, its really cumbersome to achieve it through web user interface. Basically, you have to go to each group where the source user is member of, and add target user to it. Here is how we can automate this task by using PowerShell: #Function to copy group memberships from one user to another Function Clone-SPOUserGroupPermission($SiteURL, $SourceUserID, $TargetUserID) { Try { #Get the Site collection $Site = Get-SPOSite $SiteURL #Get the Source user $SourceUser = Get-SPOUser -Site $Site -LoginName $SourceUserID #Get All groups of the source User $UserGroups = $SourceUser.Groups
SharePoint Online: Clone User Group Memberships using PowerShell SharePoint Online: Clone User Group Memberships using PowerShell Reviewed by Salaudeen Rajack on April 19, 2018 Rating: 5

How to Copy a Folder in SharePoint Online using PowerShell?

April 18, 2018    , , , ,
Requirement: Copy Folder in SharePoint Online using PowerShell How to a Copy Folder in SharePoint Online? Copying a folder in SharePoint Online modern experience is quite simple. Navigate to your SharePoint Online Document Library >> Select the Folder to Copy From the Toolbar, Click on "Copy to" button Select the destination location you want to Copy the folder. You can either choose the same document library/site or choose a different site collection or subsite. Use "Browse Sites" to see a full list of sites that you can copy to. Click on "New Folder" and provide a name to the copy and then Click on "Copy here" button to start copying the folder. This Copies the folder with all its files & sub-folders to the selected destination. Please note, the "Copy To" is not available in SharePoint Online classic experience. SharePoint Online: Copy Folder using PowerShell Lets copy a folder in SharePoint Online usi
How to Copy a Folder in SharePoint Online using PowerShell? How to Copy a Folder in SharePoint Online using PowerShell? Reviewed by Salaudeen Rajack on April 18, 2018 Rating: 5

SharePoint Online: How to Reindex a List or Document Library using PowerShell?

April 17, 2018    , , , , , ,
Requirement: SharePoint Online Reindex list or document library using PowerShell PowerShell to Reindex List in SharePoint Online  Although Items are fully indexed by Full crawl in SharePoint, Reindex feature in SharePoint helps to recrawl and perform full indexing during the next incremental or continuous crawl. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Variables for Processing $SiteUrl = "https://crescenttech.sharepoint.com" $ListName="Projects" #Setup Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredenti
SharePoint Online: How to Reindex a List or Document Library using PowerShell? SharePoint Online: How to Reindex a List or Document Library using PowerShell? Reviewed by Salaudeen Rajack on April 17, 2018 Rating: 5

SharePoint Online: PowerShell to List Deleted Sites

April 17, 2018    , , , ,
Requirement: Find All Deleted Site Collections in SharePoint Online How to Get Deleted Sites in SharePoint Online? Deleted site collection are sent to recycle bin in SharePoint Online and stays there for 92 days until they purged permanently. To check if a site collection is deleted and exists in recycle bin, Login to SharePoint Online Admin Center >> Click on "Deleted Sites" link from left navigation (In classic Admin Center, Go to "Site Collections" link from left navigation and click on "Recycle Bin" Icon) From here, You can either restore or permanently delete the site collection! PowerShell to Get Deleted Site Collections in SharePoint Online: Using SharePoint Online Management Shell, you can get a list of deleted site collections as $AdminSiteURL = "https://crescenttech-admin.sharepoint.com" #Connect to SharePoint Online Connect-SPOService -URL $AdminSiteURL -Credential (Get-Credential) #Get all Deleted Sites Get-S
SharePoint Online: PowerShell to List Deleted Sites SharePoint Online: PowerShell to List Deleted Sites Reviewed by Salaudeen Rajack on April 17, 2018 Rating: 5

SharePoint Online: Bulk Delete All List Items using PowerShell

April 16, 2018    , ,
Requirement: Bulk Delete SharePoint Online List Items using PowerShell Delete All List Items in SharePoint Online using PowerShell: We've a list in SharePoint online - Office 365 site with bunch of items. Need them to be deleted in bulk rather deleting one by one from SharePoint web UI. Here is the script to delete list items in bulk in SharePoint online Office 365 using Client Side Object Model (CSOM) with PowerShell. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Variables for Processing $SiteUrl = "https://crescenttech.sharepoint.com/sites/Marketing" $ListName="LargeList" $BatchSize = 100 #Setup Credentials to connect $Cred = Get-Credential Try { #Setup the context $Ctx = Ne
SharePoint Online: Bulk Delete All List Items using PowerShell SharePoint Online: Bulk Delete All List Items using PowerShell Reviewed by Salaudeen Rajack on April 16, 2018 Rating: 5

SharePoint Online: Get All Terms from a Term Set using Powershell

April 15, 2018    , , , ,
Requirement: PowerShell to Get All Terms from a Term Set in SharePoint Online SharePoint Online: Get Terms from a Term Set using PowerShell #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll" #Function to recursively get all child terms from a Term Function Get-SPOTerm([Microsoft.SharePoint.Client.Taxonomy.Term]$Term) { Write-host $Term.Name #Get All child terms $ChildTerms = $Term.Terms $Ctx.Load($ChildTerms) $Ctx.ExecuteQuery() #Process all child terms Foreach ($ChildTerm in $ChildTerms) { $Indent = $Indent +"`t" Writ
SharePoint Online: Get All Terms from a Term Set using Powershell SharePoint Online: Get All Terms from a Term Set using Powershell Reviewed by Salaudeen Rajack on April 15, 2018 Rating: 5

SharePoint Online: Create Publishing Page using PowerShell

April 14, 2018    , , ,
Requirement: Create a Publishing Page in SharePoint Online using PowerShell SharePoint Online: Create Publishing Page using PowerShell CSOM #Config Variables $SiteURL = "https://crescenttech.sharepoint.com/sites/Marketing" $PageName = "About-us.aspx" $PageTitle= "About Us" $PageLayoutName = "BlankWebPartPage.aspx" $PageContent="Out Fund brings together healthcare technology companies, foundations, development financing institutions and institutional investors,` to address and impact poor healthcare outcomes in Africa and Asia. Its healthcare investments include Care Hospitals in India" #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Get the publishing Web $PublishingWeb = [Microsoft.SharePoint.Client.Publish
SharePoint Online: Create Publishing Page using PowerShell SharePoint Online: Create Publishing Page using PowerShell Reviewed by Salaudeen Rajack on April 14, 2018 Rating: 5

SharePoint Online: Get Site Collection, Web ID using PowerShell

April 11, 2018    , , , , ,
Requirement: Get the ID of a SharePoint Online site collection or subsite using PowerShell SharePoint Online: PowerShell to Get Site Collection ID #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Parameter $SiteURL = "https://crescenttech.sharepoint.com/Sites/Marketing" #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Get Site and Web Objects $Ctx.Load($Ctx.Site) $Ctx.Load($Ctx.Web) $Ctx.ExecuteQuery() Write-host -f Green "Site ID:"$Ctx.Site.Id Write-host -f Green "Web ID:"$Ctx.W
SharePoint Online: Get Site Collection, Web ID using PowerShell SharePoint Online: Get Site Collection, Web ID using PowerShell Reviewed by Salaudeen Rajack on April 11, 2018 Rating: 5

SharePoint Online: PowerShell to Update List View

April 10, 2018    , , , ,
Requirement: Update List View in SharePoint Online using PowerShell SharePoint Online: PowerShell to Update List View Lets apply a filter to "Active Projects" view to get all projects with "Project Status" field value as "Active" #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Function to Update List View in SharePoint Online Function Update-SPOListView($SiteURL, $ListName, $ViewName, $ViewQuery) { Try { #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username,
SharePoint Online: PowerShell to Update List View SharePoint Online: PowerShell to Update List View Reviewed by Salaudeen Rajack on April 10, 2018 Rating: 5

SharePoint Online: How to Make List Field Read Only using PowerShell?

April 10, 2018    , , , , ,
Requirement: Make a Field Read Only in SharePoint Online List How to Set a List Field to Read Only in SharePoint Online using PowerShell? #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Function to set a Field to Read Only in SharePoint Online List Function Set-SPOFieldReadOnly($SiteURL, $ListName, $FieldInternalName, [Bool]$IsReadOnly) { Try { #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Get the List $List=$Ctx.Web.Lists.GetByTitle($ListName)
SharePoint Online: How to Make List Field Read Only using PowerShell? SharePoint Online: How to Make List Field Read Only using PowerShell? Reviewed by Salaudeen Rajack on April 10, 2018 Rating: 5

SharePoint Online: Set Default Value for List Column using PowerShell

April 10, 2018    , , , , ,
Requirement: SharePoint Online Set Column default value Settings How to Set Column default value Settings in SharePoint Online? To preset a default value for a field in SharePoint Online list, Go to the List Settings >> Under "Columns", Pick the field by clicking on its title  Under "Default Value" section, you can specify the default value for the field, so that it gets populated automatically without user input. You can also specify the default value for a column at the time of creation! Configure Default Column Value using PowerShell CSOM: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Function to set default value of a field Function Set-SPOFieldDefaultValue($SiteURL, $ListNam
SharePoint Online: Set Default Value for List Column using PowerShell SharePoint Online: Set Default Value for List Column using PowerShell Reviewed by Salaudeen Rajack on April 10, 2018 Rating: 5

SharePoint Online: Disable Attachment in List using PowerShell

April 09, 2018    , , , ,
Requirement: Disable Attachment in SharePoint Online List How to Disable Attachment in SharePoint List? To disable attachments in SharePoint Online list, Go to the List Settings >>Advanced Settings >> Set "Disable" option for Attachments! SharePoint Online: PowerShell to Disable Attachments in a List #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Disable-SPOListAttachment($SiteURL,$ListName) { Try { #Get Credentials to connect $Cred= Get-Credential #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username
SharePoint Online: Disable Attachment in List using PowerShell SharePoint Online: Disable Attachment in List using PowerShell Reviewed by Salaudeen Rajack on April 09, 2018 Rating: 5

SharePoint Online: Remove User or Group from List Permissions using PowerShell

April 08, 2018    , , , , ,
Requirement: Remove user or group from list permissions in SharePoint Online using PowerShell PowerShell to Remove User from List Permissions in SharePoint Online #Load SharePoint Online Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Remove User from List Permissions Function Remove-SPOUserFromListPermission($SiteURL,$ListName,$UserAccount) { #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = $Cred #Get the List $List=$Ctx.Web.Lists.GetByTitle($ListName)
SharePoint Online: Remove User or Group from List Permissions using PowerShell SharePoint Online: Remove User or Group from List Permissions using PowerShell Reviewed by Salaudeen Rajack on April 08, 2018 Rating: 5

Add AD Group to SharePoint Online Group using PowerShell

April 08, 2018    , , , , ,
Requirement: Add AD Group to SharePoint Online Group using PowerShell PowerShell to Add Active Directory Group to SharePoint Online Group #Load SharePoint Online Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Add-ADGroupToSP($SiteURL,$ADGroupName,$SPGroupName) { #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password) Try { #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Ctx.Credentials = $Cred #Get the Web and SharePoint Group $Web = $Ctx.Web $Group= $Web.SiteGroups.GetByName($SPGroupName) #Resolve the AD Se
Add AD Group to SharePoint Online Group using PowerShell Add AD Group to SharePoint Online Group using PowerShell Reviewed by Salaudeen Rajack on April 08, 2018 Rating: 5
Powered by Blogger.