blog.icewolf.ch

Let's talk about IT!
posts - 2204, comments - 295, trackbacks - 0

My Links

Archives

Post Categories

icewolf

PowerShell

Scripting - the new way
Create Azure AD App Registration with Microsoft.Graph PowerShell

Hi All, In this Blog Post i explain you how to create an Azure AD App Registration with the Microsoft.Graph PowerShell. You need to have the Azure Active Directory Role "Application Administrator" or "Application Developer". By the way. All the Code is used here is also on my GitHub Repo https://github.com/BohrenAn/GitHub_PowerShellScripts/blob/main/AzureAD/CreateAADApp-MgGraph.ps1 #Import Module Import-Module Microsoft.Graph.Authentication Import-Module Microsoft.Graph.Applications ############################################################################### #Connect-MgGraph #Connect to your Azure Active Directory with "Application Adminstrator" or "Global Administrator" Role ############################################################################### Connect-MgGraph -Scopes "Application.Read.All","Application.ReadWrite.All","User.Read.All" Get-MgContext That's the User Approval when you sign in to Microsoft Graph with these Scopes ############################################################################### #Create AAD Application ############################################################################### $AppName =  "DemoApp" $App = New-MgApplication -DisplayName $AppName $APPObjectID = $App.Id ############################################################################### #List Applications ############################################################################### Get-MgApplication -ApplicationId $APPObjectID List all the Details of an Application Get-MgApplication | Where-Object {$_.DisplayName...

posted @ Friday, December 2, 2022 2:26 PM | Filed Under [ PowerShell Azure ]

Microsoft.Graph PowerShell Module 1.18.0 released

Hi All, A few hours ago, Microsoft has released a new Version of the Microsoft.Graph PowerShell Module. Apparently it covers the latest API version and Help as well as a minor fix. Microsoft.Graph 1.18.0 https://www.powershellgallery.com/packages/Microsoft.Graph/1.18.0 1.18.0 Release Notes https://github.com/microsoftgraph/msgraph-sdk-powershell/releases Let's check the installed Version and what's available on the PowerShell Gallery Get-InstalledModule Microsoft.Graph Find-Module Microsoft.Graph To install the newest Version of the PowerShell Modules and also uninstalling the old Versions, you can use my GitHub Script. It takes a while until all Modules are installed. Wait until "Cleanup finished" is shown. #Run Script directly from GitHub $ScriptFromGitHub = Invoke-WebRequest "https://raw.githubusercontent.com/BohrenAn/GitHub_PowerShellScripts/main/ExchangeOnline/GraphAPI/Cleanup-GraphModules.ps1" Invoke-Expression $($ScriptFromGitHub.Content) To list the Modules you can use the following Command Get-Module Microsoft.Graph* -ListAvailable Regards Andres Bohren

posted @ Friday, December 2, 2022 7:47 AM | Filed Under [ PowerShell ]

MSIdentityTools PowerShell Module v2.0.26 released

Hi All, Just a few Hours ago, a new Version of MSIdentity Tools has been released. MSIdentityTools 2.0.26 https://www.powershellgallery.com/packages/MSIdentityTools/2.0.26 Uninstall the old version of the PowerShell Module and install the newest one Get-InstalledModule MSIdentityTools Find-Module MSIdentityTools Uninstall-Module MSIdentityTools Install-Module MSIdentityTools Get-InstalledModule MSIdentityTools To see what commands are available use the following command Get-Command -Module MSIdentityTools Regards Andres Bohren

posted @ Wednesday, November 30, 2022 9:37 AM | Filed Under [ PowerShell ]

Create Microsoft Teams Holidays for Switzerland 2023

Hi All, In Microsoft Teams the Holidays have always been a bit Tricky. You can create Holidays direct in Teams Admin Center under Voice > Holidays or during the Creation or Modification of a Autoattendant. The Problem is that you create the Holidays and these are mostly set up to a specific Year. Next year you have to redo the Holidays and go through all Autoattendants to see if they are still linked. I'll show you how to create and update the Microsoft Teams Holidays for Switzerland and keep them up do date. I had considered diffrent approaches: Create Holidays for each...

posted @ Monday, November 28, 2022 4:43 PM | Filed Under [ PowerShell MicrosoftTeams ]

PowerShell Module Microsoft.Online.SharePoint.PowerShell 16.0.23109.12000 released

Hi All, Some hours ago, Microsoft has released a new Version of the Microsoft.Online.SharePoint.PowerShell Module to the PowerShell Gallery. Microsoft.Online.SharePoint.PowerShell 16.0.23109.12000 https://www.powershellgallery.com/packages/Microsoft.Online.SharePoint.PowerShell/16.0.23109.12000 Check what Module Version is installed and what's available from the PowerShell Gallery Get-InstalledModule Microsoft.Online.SharePoint.PowerShell Find-Module Microsoft.Online.SharePoint.PowerShell Uninstall the old Module and install the new Version Uninstall-Module Microsoft.Online.SharePoint.PowerShell Install-Module Microsoft.Online.SharePoint.PowerShell Get-InstalledModule Microsoft.Online.SharePoint.PowerShell Regards Andres Bohren

posted @ Saturday, November 26, 2022 8:24 AM | Filed Under [ PowerShell ]

Deploy PowerShell 7 Script on Azure Automation

Hi All, In this Blog Post i explain how to Create and Depoly a PowerShell 7 Runbook for Azure Automation with the AZ PowerShell Module. #Connect to Azure Connect-AzAccount #Get Automation Account Get-AzAutomationAccount I have two Azure Automation Accounts. In this Example, we use the second one. ############################################################################### # Create Runbook ############################################################################### $accountName = "icewolfautomation" $rgName = "RG_DEV" $location = "West Europe" $RunbookName = "DemoPS7" $scriptContent = @'     #Connect to Exchange with Managed Identity     $tenant = "icewolfch.onmicrosoft.com"     Connect-ExchangeOnline -ManagedIdentity -Organization $tenant     #Get Accepted Domain     Get-AcceptedDomain | Format-Table DomainName, DomainType     #Disconnect Exchange Online     Disconnect-ExchangeOnline -Confirm:$False '@ Invoke-AzRestMethod -Method "PUT" -ResourceGroupName $rgName -ResourceProviderName "Microsoft.Automation" `     -ResourceType "automationAccounts" -Name "${AccountName}/runbooks/${RunbookName}" -ApiVersion "2017-05-15-preview" `     -Payload "{`"properties`":{`"runbookType`":`"PowerShell7`", `"logProgress`":false, `"logVerbose`":false, `"draft`":{}}, `"location`":`"${Location}`"}" Invoke-AzRestMethod...

posted @ Saturday, November 19, 2022 11:55 AM | Filed Under [ PowerShell Azure ]

How to Manage PowerShell 5 and 7 Modules on Azure Automation

Hi All, As you might already know, i am a big Fan of Azure Automation. Recently i have used "Managed Identity with Exchange Online on Azure Automation". Yesterday there was a Release of "Microsoft.Graph PowerShell Module 1.17.0" and the Question of how to update the PowerShell Modules on Azure Automate arises once again. Basically i've covered that already in a Blog Post earlyer this Year "Update Modules on Azure Automation with AZ PowerShell". But i think i have improved the Script a little bit. And finally i explain how to Manage the PowerShell 7 Modules on Azure Automate. #Connect to Azure Connect-AzAccount #Get Automation Account Get-AzAutomationAccount #Get Modules $accountName =...

posted @ Saturday, November 19, 2022 10:43 AM | Filed Under [ PowerShell Azure ]

Azure PowerShell Module Az 9.1.1 released

Hi All, Microsoft has released the AZ 9.1.1 PowerShell Module to the PowerShell Gallery just a few Hours ago. Az 9.1.1 https://www.powershellgallery.com/packages/az/9.1.1 Show Installed AZ Module and what's available in the PowerShell Gallery Get-InstalledModule AZ -AllVersions Find-Module AZ To uninstall all the old Modules and install the new Modules i have written a PowerShell Script that is published at my GitHub Repo. #Run Script directly from GitHub $ScriptFromGitHub = Invoke-WebRequest "https://raw.githubusercontent.com/BohrenAn/GitHub_PowerShellScripts/main/Azure/Cleanup-AZModules.ps1" Invoke-Expression $($ScriptFromGitHub.Content) The AZ Module is just a Wrapper Module for all AZ* Modules Get-Installed Module AZ* Regards Andres Bohren

posted @ Friday, November 18, 2022 9:29 AM | Filed Under [ PowerShell Azure ]

Microsoft.Graph PowerShell Module 1.17.0 released

Hi All, A few hours ago, Microsoft has released a new Version of the Microsoft.Graph PowerShell Module. Apparently it covers the latest API version and Help as well as some minor fixes. Microsoft.Graph 1.17.0 https://www.powershellgallery.com/packages/Microsoft.Graph/1.17.0 1.17.0 Release Notes https://github.com/microsoftgraph/msgraph-sdk-powershell/releases Let's check the installed Version and what's available on the PowerShell Gallery Get-InstalledModule Microsoft.Graph Find-Module Microsoft.Graph To install the newest Version of the PowerShell Modules and also uninstalling the old Versions, you can use my GitHub Script. It takes a while until all Modules are installed. Wait until "Cleanup finished" is shown. #Run Script directly from GitHub $ScriptFromGitHub = Invoke-WebRequest "https://raw.githubusercontent.com/BohrenAn/GitHub_PowerShellScripts/main/ExchangeOnline/GraphAPI/Cleanup-GraphModules.ps1" Invoke-Expression $($ScriptFromGitHub.Content) To list the Modules you can use the following Command Get-Module Microsoft.Graph* -ListAvailable Let's check...

posted @ Friday, November 18, 2022 8:30 AM | Filed Under [ PowerShell ]

How IAM Systems can use Exchange RecipientManagement PSSnapin

Hi All, I have already blogged about the Exchange 2019 Recipient Managemen PowerShell that can Manage Echange Objects without an Exchange Server running. Install and use Exchange 2019 CU12 Recipient Management PowerShell https://blog.icewolf.ch/archive/2022/04/27/install-and-use-exchange-2019-cu12-recipient-management-powershell.aspx For Identity and Access Management Systems (IAM) provisioning, management and deprovisioning based in the past on crating a Remote PowerShell to Exchange Server. How do you Address this with the new Recipient Management? In Fact there are two Solutions: You install the Recipient Management PSSnapIn on the IAM Server (Management Tools) You create a Remote PowerShell to a Server that has the...

posted @ Wednesday, November 16, 2022 9:25 PM | Filed Under [ Exchange PowerShell ]

Full PowerShell Archive

Powered by:
Powered By Subtext Powered By ASP.NET