Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eb212dc
Update ContentTypeManagement.ps1
JakubPiegza Jan 19, 2020
70c1636
Merge pull request #45 from PowershellScripts/master
PowershellScripts Jan 20, 2020
2298891
Update description.md
PowershellScripts Jan 21, 2020
1e16b49
Update description.md
PowershellScripts Jan 23, 2020
6f0f1fe
Merge pull request #5 from PowershellScripts/develop
dem123-cthulu Jan 24, 2020
33ef2cd
Update README.md
dem123-cthulu Jan 24, 2020
05216d1
Update Remove SPO subsite.ps1
dem123-cthulu Jan 24, 2020
2e6d08e
Update README.md
dem123-cthulu Jan 24, 2020
31fd01e
Started adding index
dem123-cthulu Jan 24, 2020
d20137e
Delete GetSingleContentTypeLoopParentName.ps1
dem123-cthulu Jan 24, 2020
244b59b
Delete description.md
dem123-cthulu Jan 24, 2020
9a46f80
Update description.md
dem123-cthulu Jan 24, 2020
cc5cbcc
Create description.md
PowershellScripts Jan 24, 2020
c07f482
powershell formatted
PowershellScripts Jan 25, 2020
0b55a92
Merge pull request #43 from JakubPiegza/patch-3
PowershellScripts Jan 25, 2020
f60a76b
Update ContentTypeManagement.ps1
PowershellScripts Jan 25, 2020
8fe4fd2
Merge pull request #46 from dem123-cthulu/master
PowershellScripts Jan 25, 2020
c25d5b3
Create description.md
PowershellScripts Jan 25, 2020
d0b25b3
Add files via upload
PowershellScripts Jan 25, 2020
edea62a
Create description.md
PowershellScripts Jan 25, 2020
a7b130d
Add files via upload
PowershellScripts Jan 25, 2020
cd24040
Create description.md
PowershellScripts Jan 25, 2020
d762e88
Add files via upload
PowershellScripts Jan 25, 2020
a68d744
Create description.md
PowershellScripts Jan 25, 2020
aac8e02
Add files via upload
PowershellScripts Jan 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,60 +1,47 @@

#
# Created by Arleta Wanat, 2015
#

function Set-SPOListsContentTypesEnabled
{
param (
[Parameter(Mandatory=$true,Position=1)]
function Set-SPOListsContentTypesEnabled{
param (
[Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
[string]$AdminPassword,
[Parameter(Mandatory=$true,Position=3)]
[Parameter(Mandatory=$true,Position=3)]
[string]$Url,
[Parameter(Mandatory=$true,Position=4)]
[Parameter(Mandatory=$true,Position=4)]
[bool]$ContentTypesEnabled
)
)

$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force

$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
$ctx.ExecuteQuery()

$Lists=$ctx.Web.Lists
$ctx.Load($Lists)
$ctx.ExecuteQuery()
$Lists=$ctx.Web.Lists

$ctx.Load($Lists)
$ctx.ExecuteQuery()

Foreach($ll in $Lists)
{
$ll.ContentTypesEnabled = $ContentTypesEnabled
$ll.Update()

Foreach($ll in $Lists){
$ll.ContentTypesEnabled = $ContentTypesEnabled
$ll.Update()

try
{
$ctx.ExecuteQuery()
Write-Host $ll.Title " Done" -ForegroundColor Green
}
try{
$ctx.ExecuteQuery()
Write-Host $ll.Title " Done" -ForegroundColor Green
}
catch [Net.WebException]{
Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
}

catch [Net.WebException]
{

Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
}

}
}
}










# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Expand All @@ -68,4 +55,4 @@ $ContentTypesEnabled=$true



Set-SPOListsContentTypesEnabled -Username $Username -AdminPassword $AdminPassword -Url $Url -ContentTypesEnabled $ContentTypesEnabled
Set-SPOListsContentTypesEnabled -Username $Username -AdminPassword $AdminPassword -Url $Url -ContentTypesEnabled $ContentTypesEnabled
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ How to use?



PowerShell
```PowerShell
# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Expand All @@ -37,7 +37,7 @@ Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extens
$Username="admin@tenant.onmicrosoft.com"
$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
$AdminUrl="https://tenant.sharepoint.com/sites/teamsitewithlibraries"

```
a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths
b) Instead of "admin@tenant.onmicrosoft.com" enter you username
c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types
Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions File Management/Get SPO Files from a folder/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ Get-SPOFolderFiles -Username trial@trialtrial123.onmicrosoft.com -Url https://tr
```







---
Expand All @@ -69,10 +66,6 @@ Get-SPOFolderFiles -Username trial@trialtrial123.onmicrosoft.com -Url https://tr







---
If you want to get all files from all the folders, you can use Get-SPOFolder cmdlet to retrieve the folders and then for each folder retrieve the files.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<#
This script works only in limited number of scenarios. If you have more than one subscription, use another script 'CheckLicensesWithServiceName' also published on Technet Gallery
((Get-Msoluser -UserPrincipalName test2@trial765.onmicrosoft.com).licenses.servicestatus | where {$_.ServicePlan.ServiceType -eq "Exchange"})

#>

$PlanToCheck="Exchange"
$CSVPath="" #E:\technet\UsersWithDisabledEXO.csv Enter only if you want to export to csv
$ChecksWhetherThePlanIs="Disabled" #Disabled, Success or PendingActivation


<#Plans to choose from. Please enter only one value above
ProjectWorkManagement
Sway
SCO
YammerEnterprise
RMSOnline
MicrosoftOffice
MicrosoftCommunicationsOnline
Exchange



With SharePoint you may prefer to use ServiceName property and SharePointEnterprise and SharePointWAC values
#>

#connects to MSOL
Connect-MsolService


#Gets the users
$Users = Get-MSolUser -All

if($Users -ne $null)
{
Write-Host "Loaded all users."
}
else
{
Write-Host "Couldn't get the users."
}


if($CSVPath)
{
Write-Host "Users will be saved to" $CSVPath
}

foreach($user in $users)
{
#returns ServicePlan and ProvisioningStatus
$serviceStatus=((Get-Msoluser -UserPrincipalName $user.userPrincipalName).licenses.servicestatus | where {$_.ServicePlan.ServiceType -eq $PlanToCheck})
if($serviceStatus.ProvisioningStatus -eq "Disabled")
{
Write-Host $user.UserPrincipalName
if($CSVPath)
{
Export-Csv -InputObject $user -LiteralPath $CSVPath -Append
}
}
}


78 changes: 78 additions & 0 deletions Licensing/Check User Licenses using plan type/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
A script to check user licenses by the plan type.



The plan type is the same for multiple subscriptions, e.g.

EXCHANGE_S_STANDARD available in Office 365 Business and EXCHANGE_S_ENTERPRISE available in Enterprise 3 are of the same type - Exchange.



If you have multiple subscriptions in your tenant and would like to check a particular service, e.g. only Exchange_S_Enterprise, use the Check user licenses using Service Name script here:

https://gallery.technet.microsoft.com/Check-user-licenses-using-461b317c



How to use?

1. Make sure you have installed Azure AD module available here: https://msdn.microsoft.com/en-us/library/azure/jj151815(v=azure.98).aspx

2. Download the script and open it (in Notepad, ISE, whatever you prefer).

3. In the first lines you see:



PowerShell
$PlanToCheck="Exchange"
$CSVPath="" #E:\technet\UsersWithDisabledEXO.csv Enter only if you want to export to csv
$ChecksWhetherThePlanIs="Disabled" #Disabled, Success or PendingActivation


<#Plans to choose from. Please enter only one value above
ProjectWorkManagement
Sway
SCO
YammerEnterprise
RMSOnline
MicrosoftOffice
MicrosoftCommunicationsOnline
Exchange



In $PlanToCheck="Enter the name of the plan you want to check"

In $CSVPath leave as it is if you don't want a csv report, or if you do, enter path in inverted commas like in the example below:



PowerShell
$CSVPath="E:\technet\UsersWithDisabledEXO.csv"



$ChecksWhetherThePlanIs if set to "Disable" (as it is) will check for all disabled plans. If you want to check successfully provisioned or pending activation, enter "Success" or "PendingActivation". Important! Disabled are only the services where you assigned the license but not all services are active (e.g. E3 is assigned, but Exchange Online is unmarked). See example below:



Here the license is disabled:







Here it is NOT:









4. Save the script and drag&drop it to Powershell. It will ask you for credentials and display a list of users on the screen.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading