This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-userfromdevicegroup { | |
<# | |
.SYNOPSIS | |
Retrieves user information for devices in a specified Azure AD group using Microsoft Graph. | |
.DESCRIPTION | |
This function connects to Microsoft Graph, retrieves all members (devices) of a specified Azure AD group, | |
and for each device, uses Get-MgDeviceRegisteredOwner to find the registered user(s). | |
It returns user and device details for reporting or automation purposes. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-UserFromDeviceGroup { | |
<# | |
.SYNOPSIS | |
Retrieves user information for devices in a specified Azure AD group using Microsoft Graph. | |
.PARAMETER GroupName | |
The display name of the Azure AD group containing devices. | |
#> | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region ERRORHANDLING | |
Try { | |
# Make sure scriptname exists for creating ticket subject line | |
If ($null -eq $scriptname -or $scriptname -notlike "*.ps1") { | |
If ( $null -ne $BuildScript) { $scriptName = $BuildScript } | |
ElseIf ($null -ne $env:scriptname) { $scriptName = $env:scriptName } | |
Else { $scriptname -eq "$($PSItem.InvocationInfo.ScriptName)" } | |
} | |
# Make sure the application ID and api secret are available | |
If ($Env:ManageEngineClientID) { $Config.ManageEngine.ClientID = $Env:ManageEngineClientID } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function global:Invoke-ManageEngineRequest { | |
<# | |
.SYNOPSIS | |
Creates a new ticket in ManageEngine ServiceDesk Plus | |
.DESCRIPTION | |
This function is used to create a new ticket in ManageEngine ServiceDesk Plus using a REST API Call. | |
.Parameter ManageEngineURI | |
The URI for the ManageEngine API | |
.PARAMETER AttachmentPath | |
The path to the file to upload to the ticket (optional) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
if ($host.Name -eq 'ConsoleHost') { | |
Import-Module PSReadLine | |
} | |
Import-Module -Name Terminal-Icons | |
oh-my-posh --init --shell pwsh --config $env:POSH_THEMES_PATH/jandedobbeleer.omp.json | Invoke-Expression | |
oh-my-posh --init --shell powershell --config $env:POSH_THEMES_PATH/jandedobbeleer.omp.json | Invoke-Expression | |
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-RDAPWhois { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Position = 0, Mandatory, HelpMessage = "Enter an IP Address. Both IPv4 and IPv6 are supported", ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[ValidateScript({ $_ -as [ipaddress] })] | |
[string]$IP ## Mandatory variable: IP address to query. | |
) | |
try { | |
$rdapBaseUrl = "https://rdap.arin.net/registry" ## Set the RDAP url to query. This is the ARIN RDAP server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-RDAPWhois { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Position = 0, Mandatory, HelpMessage = "Enter an IP Address. Both IPv4 and IPv6 are supported", ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[ValidateScript({ $_ -as [ipaddress] })] | |
[string]$IP ## Mandatory variable: IP address to query. | |
) | |
try { | |
$rdapBaseUrl = "https://rdap.arin.net/registry" ## Set the RDAP url to query. This is the ARIN RDAP server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.0 | |
Function Get-MGUserCalendarEvents { | |
<# | |
.SYNOPSIS | |
This script will connect to the Microsoft Graph API and retrieve all calendar events for a list of users. | |
.DESCRIPTION | |
This script will connect to the Microsoft Graph API and retrieve all calendar events for a list of users. | |
.PARAMETER ClientID | |
The Client ID of the Azure AD Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-MsolLicenseServicePlan { | |
<# | |
.SYNOPSIS | |
Enables service plans from MSOnline licenses applied to users. | |
.DESCRIPTION | |
Will enable one or more service plans from a user's MSOnline account or specific MSOnline license on an account. | |
.EXAMPLE | |
Get-MsolLicenseServicePlan -UserPrincipalName user@domain.com | |
List all service plans from all licenses for a single user | |
.EXAMPLE |