Skip to content

Instantly share code, notes, and snippets.

AlexanderHolmeset

Block or report user

Report or block AlexanderHolmeset

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ExpiredUsers.ps1
#"Password!" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "D:\temp\PassordUserExpireScript.txt"
$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "admin@contoso", (Get-Content "d:\temp\PassordUserExpireScript.txt" | ConvertTo-SecureString)
#Gets all users thats enabled and have a expiration date.
$Users = Get-ADUser -Filter * -Properties AccountExpirationDate | select AccountExpirationDate,Enabled,UserPRincipalName,samaccountname,name | Where-Object{$_.Enabled -eq $true -and $_.AccountExpirationDate}
#Todays date.
$today = Get-Date -Format dd/MM/yyyy
View TeamsAutoAttendantHolidayScheduleGenerator.ps1
### Teams Auto Attendant Holiday Schedule Generator ###
### Version 1.0 ###
### Author: Alexander Holmeset ###
### Email: alexander.holmeset@gmail.com ###
### Twitter: twitter.com/alexholmeset ###
### Blog: alexholmeset.blog ###
#Enter you AutoAttendant ID
$AutoAttendantID = "159980fb-ec85-4c3d-b8be-e09a2a17f4eb"
@AlexanderHolmeset
AlexanderHolmeset / PlannerMigration.ps1
Last active Nov 11, 2019
Microsoft Planner Tenant To Tenant Mirgration
View PlannerMigration.ps1
### Microsoft Planner Tenant To Tenant Migration Script ###
### ###
### Version 1.0 ###
### ###
### Author: Alexander Holmeset ###
### ###
### Twitter: twitter.com/alexholmeset ###
### ###
### Blog: alexholmeset.blog ###
View GraphErrorCatching.ps1
try{Invoke-RestMethod -Body $RequestBody -Method POST -Uri $uri -ContentType "application/json" -Headers @{Authorization = "Bearer $token"}}
catch{
$ResponseResult = $_.Exception.Response.GetResponseStream()
$ResponseReader = New-Object System.IO.StreamReader($ResponseResult)
$ResponseBody = $ResponseReader.ReadToEnd()
}
$ResponseBody
View SplitSfBUnasignedNumberRanges.ps1
$Users = Import-Csv -Path "c:\temp\users.csv"
foreach($user in $Users){
#Gets all unassigned number ranges. This needs to be done for each user in the foreach loop, as you keep changing the ranges.
$UnasignedNumbers = Get-CsUnassignedNumber
#Need to loop through all ranges to find which one the users number belong to.
foreach($Range in $UnasignedNumbers){
View TeamsGIFChampions.ps1
$GIFStats = @()
$apiUrl = "https://graph.microsoft.com/v1.0/groups"
$myProfile = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken"} -Uri $apiUrl -Method Get
$teams = $myProfile.value
foreach($team in $teams){
if($team.resourceProvisioningOptions -eq 'Team'){
View RemoveWiki.ps1
#Application logon
# Azure AD OAuth Application Token for Graph API
# Get OAuth token for a AAD Application (returned as $token)
#Application (client) ID, tenant ID and secret
$clientId = "xxxx"
View ProjectTeamStructure.ps1
Param(
[Parameter (Mandatory= $true)]
[String] $teamname,
[Parameter (Mandatory= $true)]
[String] $owner,
View CreateNewTeamsTeam.ps1
Param(
[Parameter (Mandatory= $true)]
[String] $teamname,
[Parameter (Mandatory= $true)]
[String] $owner
)
You can’t perform that action at this time.