Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ce5fb0b
closes #10
PowershellScripts Feb 15, 2020
a8907a0
Create description.md
PowershellScripts Feb 15, 2020
59c1b80
Add files via upload
PowershellScripts Feb 15, 2020
1f89f7c
Create description.md
PowershellScripts Feb 15, 2020
6bce6ea
Add files via upload
PowershellScripts Feb 15, 2020
02489de
Create description.md
PowershellScripts Feb 15, 2020
ba3fe06
Add files via upload
PowershellScripts Feb 15, 2020
d09c729
Create description.md
PowershellScripts Feb 15, 2020
5020e1a
Add files via upload
PowershellScripts Feb 15, 2020
592357b
Rename description.md to readme.md
PowershellScripts Feb 15, 2020
046bfb8
Create description.md
PowershellScripts Feb 15, 2020
e75f20a
Create txt.txt
PowershellScripts Feb 15, 2020
7cbaf03
Add files via upload
PowershellScripts Feb 15, 2020
0a8d26d
Add files via upload
PowershellScripts Feb 15, 2020
4b904b0
Create description.md
PowershellScripts Feb 15, 2020
da66b85
Create txt.txt
PowershellScripts Feb 15, 2020
b280f3c
Add files via upload
PowershellScripts Feb 15, 2020
29e3780
Add files via upload
PowershellScripts Feb 15, 2020
a4a72bc
Create description.md
PowershellScripts Feb 15, 2020
072bdbd
Add files via upload
PowershellScripts Feb 15, 2020
0e76cf1
Create description.md
PowershellScripts Feb 15, 2020
1bcc3a3
Add files via upload
PowershellScripts Feb 15, 2020
03934e9
Create README.md
PowershellScripts Feb 15, 2020
0d39899
Add files via upload
PowershellScripts Feb 15, 2020
2686ebf
Create description.md
PowershellScripts Feb 15, 2020
f5255ac
Add files via upload
PowershellScripts Feb 15, 2020
b759fb5
Create description.md
PowershellScripts Feb 15, 2020
3fcbd6d
Add files via upload
PowershellScripts Feb 15, 2020
0c7cc88
Create description.md
PowershellScripts Feb 16, 2020
610d6a3
Add files via upload
PowershellScripts Feb 16, 2020
3b697f2
compatibility check
PowershellScripts Feb 16, 2020
d45528a
structure fixes
PowershellScripts Feb 16, 2020
ceb0945
Create description.md
PowershellScripts Feb 16, 2020
34996f0
Add files via upload
PowershellScripts Feb 16, 2020
8ff408e
Create description.md
PowershellScripts Feb 16, 2020
1d9e2f1
Add files via upload
PowershellScripts Feb 16, 2020
5cbf729
Create description.md
PowershellScripts Feb 16, 2020
ad32ba2
Add files via upload
PowershellScripts Feb 16, 2020
af8051d
Create description.md
PowershellScripts Feb 16, 2020
a55cce7
Add files via upload
PowershellScripts Feb 16, 2020
069645a
Create description.md
PowershellScripts Feb 16, 2020
0bf05ef
Add files via upload
PowershellScripts Feb 16, 2020
e81b98c
Create description.md
PowershellScripts Feb 16, 2020
df6f121
Add files via upload
PowershellScripts Feb 16, 2020
9030f8e
Update description.md
PowershellScripts Feb 16, 2020
f4aed4e
Create description.md
PowershellScripts Feb 16, 2020
7b44ded
Add files via upload
PowershellScripts Feb 16, 2020
a20992a
compatibility test
PowershellScripts Feb 16, 2020
File filter

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
Expand Up @@ -4,7 +4,7 @@ A short script to find all lists across a site collection and its subsites where

Very useful if you receive an error message:

<img src="../Remove a content type from all lists in a site/Error (4).PNG" width="850">
<img src="../Remove a content type from all lists in a site/Error.PNG" width="850">



Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ Here it is NOT:


<br/><br/>
<b>Enjoy and please share feedback!</b>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

<#

#>


$CSVPath="" #Enter only if you want to export to csv, e.g. E:\technet\UsersWithDisabledEXO.csv




#connects to MSOL
Connect-MsolService


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

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


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


# Check each user for licenses
foreach($user in $users)
{
# If user has more than 1 license assigned, he will appear twice in the report
foreach($license in (Get-Msoluser -UserPrincipalName $user.userPrincipalName).licenses)
{
$ss=$license.ServiceStatus
$count=$ss.Count
$uss=New-Object PSObject
$uss | Add-Member -MemberType NoteProperty -Name "UPN" -Value $user.UserPrincipalName
$uss | Add-Member -MemberType NoteProperty -Name "License" -Value $license.AccountSkuId
$uss | Add-Member -MemberType NoteProperty -Name "Office" -Value (Get-Msoluser -UserPrincipalName $user.userPrincipalName).Office

# Looping through all the services, like TEAMS1, SharePointWAC, etc. and their statuses
for($i=0;$i -lt $count; $i++)
{
$uss | Add-Member -MemberType NoteProperty -Name $ss[$i].ServicePlan.ServiceName -Value $ss[$i].ProvisioningStatus
}

#Printing out the user info
$uss

# If the path to CSV is specified, all info will be exported
if($CSVPath)
{
$uss | export-csv $CSVPath -Append -Force
}
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Short Powershell script to export user licenses and services' provisioning status.



The script is a variation on Get user licenses and services' provisioning statuses . It accounts for the fact that one user may have more than one license assigned and creates records per given user's license.

That means that in the exported csv file, a user with 2 licenses will appear twice, like this:











How to use?


1. Download and run the script.

2. During execution it will ask you for Office 365 Admin credentials

3. If you want to create a report on the users (apart from seeing the info on the screen also export data to a csv), there is a built-in function in the script, and you just need to update the following line:





PowerShell
$CSVPath="C:\Users\Arletka\Documents\usss34.csv"



Expected results


During script execution:







In a csv file:






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
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 @@
n
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,58 @@

<#

#>


$CSVPath="" #Enter only if you want to export to csv, e.g. E:\technet\UsersWithDisabledEXO.csv




#connects to MSOL
Connect-MsolService


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

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


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

foreach($user in $users)
{

$ss=(Get-Msoluser -UserPrincipalName $user.userPrincipalName).licenses.servicestatus
$count=$ss.Count
$uss=New-Object PSObject
$uss | Add-Member -MemberType NoteProperty -Name "UPN" -Value $user.UserPrincipalName
$uss | Add-Member -MemberType NoteProperty -Name "License" -Value (Get-Msoluser -UserPrincipalName $user.userPrincipalName).licenses.accountskuid
$uss | Add-Member -MemberType NoteProperty -Name "Office" -Value (Get-Msoluser -UserPrincipalName $user.userPrincipalName).Office
for($i=0;$i -lt $count; $i++)
{
$uss | Add-Member -MemberType NoteProperty -Name $ss[$i].ServicePlan.ServiceName -Value $ss[$i].ProvisioningStatus
}

$uss
if($CSVPath)
{
$uss | export-csv $CSVPath -Append -Force
}
#(Get-Msoluser -UserPrincipalName $user.userPrincipalName) | select UserPrincipalName, licenses | export-csv C:\Users\Arleta.Wanat\Documents\userrr4.csv -Append -Force #.servicestatus

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Short Powershell script to export user licenses and services' provisioning status.





How to use?


1. Download and run the script.

2. During execution it will ask you for Office 365 Admin credentials

3. If you want to create a report on the users (apart from seeing the info on the screen also export data to a csv), there is a built-in function in the script, and you just need to update the following line:



PowerShell
$CSVPath="C:\Users\Arletka\Documents\usss34.csv"

Expected results


During script execution:







In a csv file:








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,60 @@
function Get-SPOListEventreceivers
{
param (
[Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
$AdminPassword,
[Parameter(Mandatory=$true,Position=3)]
[string]$Url
)

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

try
{
$ctx.ExecuteQuery()
} catch [Net.WebException]
{

Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red
}

$ctx.Load($ctx.Site)
$ctx.Load($ctx.Web.Lists)
$ctx.ExecuteQuery()
Write-Host $ctx.Web.Lists.Count
for($j=0;$j -lt $ctx.Web.Lists.Count;$j++)
{
$lista=$ctx.Web.Lists[$j]
$ctx.Load($lista)
$ctx.ExecuteQuery()
$recevery=$lista.EventReceivers
$ctx.Load($recevery)
$ctx.ExecuteQuery()
Write-Host $recevery.Count $lista.Title

for($i=0;$i -lt $recevery.Count ; $i++)
{
$ctx.Load($recevery[$i])
$ctx.ExecuteQuery()
Write-Output $recevery[$i]
}

}

}


# 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"

# Insert the credentials and the name of the admin site
$Username="admin@tenant.onmicrosoft.com"
$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
$Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries"


Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
A short solution to find event receivers on your SPO lists.



1. Install SharePoint Online SDK

2. Download the file and open (e.g. in NotePad)

3. Scroll down to these lines

```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"

# Insert the credentials and the name of the admin site
$Username="admin@tenant.onmicrosoft.com"
$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
$Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries"


Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url
```
4. Check if the 2 libraries are in the same location on your computer. If yes, proceed on. If no, change the paths in the file. Usually you will be required to change folder name "15" into "16".

5. Instead of admin@tenant.onmicrosoft.com, enter the name of your site collection admin.

6. Instead of https://tenant.sharepint.com/sites/teamsitewithlibraries enter name of the site where the unwanted app is located

7. Run the script in any Powershell module.

It should ask you for your admin password



If you want to export the event-receivers' data to a .csv file, use PathToTheScript | export-csv c:\users\MyUsers\Desktop\CSVReport.csv





Sample Report

ReceiverAssembly ReceiverClass ReceiverId ReceiverName SequenceNumber Synchronization EventType ReceiverUrl Context Tag Path ObjectVersion ServerObjectIsNull TypedObject
Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.SharePoint.Portal.CommunityEventReceiver f13fb801-b306-42ea-bb1e-2f4c1e4a8e81 10000 Synchronous ItemAdding Microsoft.SharePoint.Client.ClientContext Microsoft.SharePoint.Client.ObjectPathIdentity False Microsoft.SharePoint.Client.EventReceiverDefinition
Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.SharePoint.Portal.CommunityEventReceiver cebe300c-50ac-4d88-8a4b-a63b9d6da400 10000 Synchronous ItemUpdating Microsoft.SharePoint.Client.ClientContext Microsoft.SharePoint.Client.ObjectPathIdentity False Microsoft.SharePoint.Client.EventReceiverDefinition
Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.SharePoint.Portal.CommunityEventReceiver bfc4ca11-32d6-4248-923c-fe16bcf8145d 10000 Synchronous ItemDeleting Microsoft.SharePoint.Client.ClientContext Microsoft.SharePoint.Client.ObjectPathIdentity False Microsoft.SharePoint.Client.EventReceiverDefinition
Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.SharePoint.Portal.CommunityEventReceiver 6f2b105a-4834-40df-a450-c480c5c94ef0 10000 Asynchronous ItemAdded Microsoft.SharePoint.Client.ClientContext Microsoft.SharePoint.Client.ObjectPathIdentity False Microsoft.SharePoint.Client.EventReceiverDefinition

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