This file contains 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
'' | |
' List Mapped Network Drives | |
' Copyright 2022 David Edwards <[email protected]> | |
'' | |
On Error Resume Next | |
Const strComputer = "." | |
Set objWMIService = GetObject("winmgmts:" _ | |
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") |
This file contains 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
<!DOCTYPE html> | |
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]--> | |
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en-US"> <![endif]--> | |
<!--[if IE 8]><html class="no-js lt-ie9" lang="en-US"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Hello World</title> | |
<meta name="description" content=""> |
This file contains 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-MappedDrive { | |
<# | |
.SYNOPSIS | |
Returns the active drive mappings of a hosts current user session | |
.DESCRIPTION | |
Get-MappedDrive is a function which (optionally) takes a remote host and returns the active drive mappings the current user session | |
.PARAMETER ComputerName | |
Specifies a remote host |
This file contains 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
/** | |
* Simple XML parser | |
* @param {String} xml | |
* @return {Object} | |
*/ | |
function parseXML(xml) { | |
var beg = -1; | |
var end = 0; | |
var tmp = 0; |
This file contains 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
|
This file contains 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
Invoke-Command -ComputerName (Read-Host -Prompt 'Enter the computer IP') -ScriptBlock { [System.Net.Dns]::GetHostName() } -Credential (Get-Credential) |
This file contains 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
# https://ss64.com/ps/left.html | |
Function left { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Position=0, Mandatory=$True,HelpMessage="Enter a string of text")] | |
[String]$text, | |
[Parameter(Mandatory=$True)] | |
[Int]$Length |
This file contains 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
## Connect to Exchange Online with MFA in ISE | |
## documentation: https://docs.microsoft.com/en-us/powershell/exchange/v1-module-mfa-connect-to-exo-powershell?view=exchange-ps | |
## tutorial: https://www.youtube.com/watch?v=EnmwLqdtDCM | |
## Download and install cmdlets from - https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell?view=exchange-ps | |
## NOTE: this method will eventually be retired - the newer method is here: https://docs.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view=exchange-ps | |
Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA + '\Apps\2.0\') -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName | Where-Object { $_ -notmatch '_none_' } | Select-Object -First 1) | |
$EXOSession = New-ExoPSSession |
This file contains 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
$EXOSession = New-ExoPSSession | |
Import-PSSession $EXOSession | Out-Null | |
Write-Host 'Connecting to Microsoft 365...' | |
Connect-MsolService | |
<# | |
#Write-Host 'Connecting to ExchangeOnline...' | |
#Connect-ExchangeOnline |
This file contains 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
$ADUser = (Get-ADUser 'exampleuser' -Properties msDS-UserPasswordExpiryTimeComputed) | |
[DateTime]::FromFileTime($ADUser.'msDS-UserPasswordExpiryTimeComputed') |
OlderNewer