Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
6ff54ca
Merge pull request #4 from WilliamMyers1/master
nickrod518 Mar 6, 2017
25b459a
A bunch of new scripts.
nickrod518 Mar 6, 2017
d9f0279
Moved to its own project at https://github.com/nickrod518/MapDrivesUt…
nickrod518 Mar 6, 2017
bea5e03
Organized.
nickrod518 Mar 7, 2017
188cfe0
Script to gather MFA details of MFA users.
nickrod518 Mar 8, 2017
8e3c37e
Merge pull request #5 from WilliamMyers1/master
nickrod518 Mar 8, 2017
609bf0b
Updated icon converter and Outlook Quarantine folder scripts.
nickrod518 Mar 8, 2017
d318614
Script to monitor users with MFA enabled
nickrod518 Mar 9, 2017
85c1583
Scripts I use on my home servers.
nickrod518 Mar 10, 2017
2fa4c14
Script to sync Gal of two o365 tenants. object table to html script f…
nickrod518 Mar 16, 2017
821d905
Quick script to get Azure AD Connect Version.
nickrod518 Mar 16, 2017
3a96dbb
Some error handling added, moved to Exchange folder.
nickrod518 Mar 17, 2017
ea385b8
Forgot identity param...
nickrod518 Mar 17, 2017
921c5f6
Updated scripts to sync Gal of 2 O365 tenants.
nickrod518 Mar 22, 2017
89bf8a4
Script to start and Exchange Online PowerShell session.
nickrod518 Mar 23, 2017
75a3128
Combined GalSync scripts into one module.
nickrod518 Mar 28, 2017
28a5f64
CaseWare SyncServer regkey add.
nickrod518 Apr 4, 2017
ed29264
Enter group name and see which groups the members have in common.
Apr 24, 2017
bcc681c
Script to consolidate old log files in a directory.
May 22, 2017
2517cee
Module to manage Zoom Video Communications account through REST API.
May 26, 2017
f18cf5d
Added WhatIf support and some comment based help.
May 31, 2017
da6e1ea
Updated Zoom module and added some tools for it.
May 31, 2017
3eebec7
Zoom module and tool updates.
Jun 1, 2017
762f4e0
Class and enum based playing cards implementation.
Jun 5, 2017
d305d34
Updates to Zoom module. Got photo upload working.
Jun 5, 2017
2cec3a6
Served a specific need renaming some tv episodes.
Jun 6, 2017
88a7dbf
Optimized Api calls on Zoom/AD sync.
Jun 8, 2017
8f4e463
Prettied code. Added verbose errors. Var name changes. Logging.
Jun 9, 2017
e29f956
Changed UPN to mail when dealing with AD user emails. Fixed typo. Par…
Jun 16, 2017
c137f01
Added note about Test-ZoomUserEmail.
Jun 16, 2017
79176d7
New script to get cool report on AD user group memberships. Other min…
Jul 26, 2017
4c5cf68
Renamed script.
Jul 26, 2017
bb79606
update to path
Jul 26, 2017
666dba0
Updated script to reset location.
Jul 26, 2017
b298d7c
Updates to module and sync settings for Zoom.
Aug 1, 2017
4b69369
Added more whatif support and disable_feedback param support.
Aug 7, 2017
845648e
Updated cat fact Api endpoint.
Aug 16, 2017
823fe73
Cat fact enhancement. Added ability to give the message a display timer.
Aug 18, 2017
2696c1c
Get disk info on a machine to determine free space and whether it's GPT.
Aug 25, 2017
60d2fdb
Fixed TLS issue with cat facts. Updated Zoom to include timezone para…
Sep 14, 2017
5dcc84f
Update changes for Azure compatibility, and set picture fix.
Nov 28, 2017
9f84d27
Add Yammer API module. Update cmtrace log writer.
Feb 23, 2018
95e0c83
Add GUI script o help manage CM mobile devices.
Feb 23, 2018
593b925
one line powershell to update user photo in AD
ashishknitcs Oct 6, 2018
1cfb88a
Merge pull request #7 from ashishknitcs/patch-1
nickrod518 Oct 7, 2018
40e9404
Get details of groups user member of
ashishknitcs Oct 10, 2018
2744e25
Merge pull request #8 from ashishknitcs/patch-2
nickrod518 Oct 10, 2018
8f2d49d
Update BTC script. Add speedtest script.
Jan 29, 2019
bac6505
Merge branch 'master' of https://github.com/nickrod518/PowerShell-Scr…
Jan 29, 2019
b40c5c4
Add scripts to install RemoteApp and refresh icons.
Jan 29, 2019
2fc7ccf
Add script to get latest nvidia drivers
nickrod518 Feb 7, 2019
2427c61
Retrieve 1st line only from input file
pm091 May 20, 2019
f743847
Merge pull request #9 from pm091/patch-1
nickrod518 May 20, 2019
f1d1846
Automatically detect module path
spitfire May 29, 2019
ab83678
Merge pull request #10 from spitfire/master
nickrod518 May 29, 2019
3e5f9c9
Automatically detect module path
spitfire May 29, 2019
03c172a
Automatically detect module path
spitfire May 29, 2019
1fcb278
Merge pull request #11 from spitfire/master
nickrod518 May 29, 2019
c5c1d95
Actually remove content from DPs
spitfire May 29, 2019
b048314
Make content removal actually work
spitfire May 29, 2019
0b0a1ad
Variable name changes
spitfire May 29, 2019
6dfbcc2
Rename variables again
spitfire May 29, 2019
7f3b3ef
Properly retire/re-instate apps
spitfire May 29, 2019
b53a916
Make renaming optional
spitfire May 29, 2019
65c4222
Various fixes
spitfire May 29, 2019
17edc96
Cleanup
spitfire May 29, 2019
b6d2cc4
Merge pull request #12 from spitfire/master
nickrod518 May 29, 2019
c257a34
Create README.md
nickrod518 May 28, 2020
0706859
Delete Zoom.psm1
nickrod518 May 28, 2020
76dfb8b
Migrate to https://github.com/nickrod518/Zoom-PowerShell
nickrod518 May 28, 2020
8ff4e9d
Migrate to https://github.com/nickrod518/Zoom-PowerShell
nickrod518 May 28, 2020
5b9c536
Migrate to https://github.com/nickrod518/Zoom-PowerShell
nickrod518 May 28, 2020
5f1304c
Migrate to https://github.com/nickrod518/Zoom-PowerShell
nickrod518 May 28, 2020
b721e5a
Update README.md
nickrod518 Feb 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (current file)",
"script": "${file}",
"args": [],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"processId": "${command.PickPSHostProcess}",
"runspaceId": 1
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": "${workspaceRoot}"
}
]
}
40 changes: 40 additions & 0 deletions AD/Get-ADCommonGroup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateScript({ Get-ADGroup -Identity $_ })]
[string]$GroupName
)

begin {
Import-Module ActiveDirectory
$Group = Get-ADGroup -Identity $GroupName
$AllGroups = @{}
}

process {
$Members = Get-ADGroupMember -Identity $Group

$Members | ForEach-Object {
$User = $_.SamAccountName

(Get-ADUser $User -Properties MemberOf).MemberOf | ForEach-Object {
# Check if the group exists in our list
if ($AllGroups.ContainsKey($_)) {
$AllGroups.($_)++
} else {
# Item is unique so add it to the list
$AllGroups.Add($_, 1)
}
}
}

Write-Host "Results:"
$AllGroups | Format-Table -AutoSize
$AllGroups.GetEnumerator() | Select-Object -Property Key, Value |
Export-Csv -Path .\$GroupName-CommonGroups.csv -NoTypeInformation

Write-Host "Common memberships:"
$AllGroups.GetEnumerator() | ForEach-Object {
if ($_.Value -eq $Members.Count) { $_.Key }
}
}
119 changes: 119 additions & 0 deletions AD/Get-ADGroupReport.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
function Get-ADGroupReport {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[string]$SaveToCsv,

[Parameter(Mandatory = $false)]
[ValidateNotNullorEmpty()]
[string]$ADGroupFilter = 'GroupCategory -eq "Distribution"'
)

begin {
Import-Module ActiveDirectory

Write-Progress -Id 1 -Activity "Getting AD groups using filter $ADGroupFilter..."
$Groups = Get-ADGroup -Filter $ADGroupFilter
$Users = @{}
}

process {
$GroupCount = $Groups.Count
$GroupCounter = 0

foreach ($Group in $Groups) {
$GroupCounter++

$GroupName = $Group.Name

$GroupProgressParams = @{
'Id' = 1
'Activity' = "Processing group $GroupCounter of $GroupCount"
'Status' = $GroupName
'PercentComplete' = ($GroupCounter / $GroupCount) * 100
}
Write-Progress @GroupProgressParams

$Members = Get-ADGroupMember $Group -Recursive

$MemberCount = $Members.Count
$MemberCounter = 0

foreach ($Member in $Members) {
$MemberCounter++

$MemberName = $Member.SamAccountName

$MemberProgressParams = @{
'Id' = 2
'ParentId' = 1
'Activity' = "Processing member $MemberCounter of $MemberCount"
'Status' = $MemberName
}
if ($MemberCount.GetType() -eq [int]) {
$MemberProgressParams.Add('PercentComplete', ($MemberCounter / $MemberCount) * 100)
}
Write-Progress @MemberProgressParams

if ($Member.objectClass -eq 'user') {
Write-Verbose "$MemberName is a user"

if (-not $Users.ContainsKey($MemberName)) {
Write-Verbose "Adding $MemberName to users list"
$Users.Add($MemberName, @{})
}

Write-Verbose "Adding $($GroupName) to $MemberName's group list"
$Users.($MemberName).Add($GroupName, $true)
} else {
Write-Verbose "$MemberName is not a user"
}
}

Write-Progress -Id 2 -ParentId 1 -Activity "Processing members" -Completed
}

$ReportProgressParams = @{
'Id' = 1
'Activity' = 'Building report...'
}
Write-Progress @ReportProgressParams

$Results = @()

foreach ($User in $Users.GetEnumerator()) {
$ADUser = Get-ADUser -Identity $User.Name -Properties @(
'physicalDeliveryOfficeName', 'Office', 'Department', 'Company', 'City', 'telephoneNumber'
)

$UserObject = New-Object psobject -Property @{
UserId = $User.Name
Email = $ADUser.UserPrincipalName
Phone = $ADUser.telephoneNumber
FullName = $ADUser.Name
Enabled = $ADUser.Enabled
PhysicalOffice = $ADUser.physicalDeliveryOfficeName
Office = $ADUser.Office
Department = $ADUser.Department
Company = $ADUser.Company
City = $ADUser.City
}

foreach ($Group in $Groups) {
$UserObject | Add-Member -MemberType NoteProperty -Name $Group.Name -Value ''

if ($User.Value.ContainsKey($Group.Name)) {
$UserObject.($Group.Name) = 'x'
}
}

$Results += $UserObject
}
}

end {
if ($SaveToCsv) { $Results | Export-Csv -Path $SaveToCsv -NoTypeInformation }
$Results
}
}
43 changes: 43 additions & 0 deletions AD/Get-DisabledUser.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#Requires –Version 3

function Get-DisabledUser {
param (
[Parameter(Mandatory = $true)]
[string]$UsersFilePath,

[Parameter(Mandatory = $false)]
[ValidateSet('Email', 'FullName', 'UserID')]
[string]$ListType = 'Email'
)

begin {
Import-Module ActiveDirectory

$Users = Get-Content -Path $UsersFilePath
$ADUsers = Get-ADUser -SearchBase 'OU=Users,DC=company,DC=LOCAL' -Filter *
$Results = @()
}

process {
foreach ($User in $Users) {
switch ($ListType) {
'Email' { $SearchProperty = 'UserPrincipalName' }
'FullName' { $SearchProperty = 'Name' }
'UserID' { $SearchProperty = 'SamAccountName' }
}

$FoundUser = $ADUsers | Where-Object { $_.$SearchProperty -eq $User }

$Results += New-Object -TypeName PSObject -Property @{
SearchProperty = $User
UserPrincipalName = $FoundUser.UserPrincipalName
Name = $FoundUser.Name
SamAccountName = $FoundUser.SamAccountName
Enabled = if ($FoundUser.Enabled) { $true } else { $false }
}
}
$Results | Sort-Object Enabled | Format-Table -AutoSize
}
}

Get-DisabledUser -UsersFilePath C:\TestUsers.txt -ListType Email
5 changes: 5 additions & 0 deletions AD/Reset-ADLastPasswordSetTime.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$creds = Get-Credential

$Me = Get-ADUser -Filter * | Where-Object -Property SamAccountName -Like userid*
$Me | Set-ADUser -ChangePasswordAtLogon $true -Credential $creds
$Me | Set-ADUser -ChangePasswordAtLogon $false -Credential $creds
65 changes: 65 additions & 0 deletions AD/Test-Credential.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<#
.DESCRIPTION
Simulates an Authentication Request in a Domain envrionment using a PSCredential Object. Returns $true if both Username and Password pair are valid.
.VERSION
1.3
.GUID
6a18515f-73d3-4fb4-884f-412395aa5054
.AUTHOR
Thomas Malkewitz @dotps1
.TAGS
PSCredential, Credential
.RELEASENOTES
Updated $Domain default value to $Credential.GetNetworkCredential().Domain.
Added support for multipul credential objects to be passed into $Credential.
.PROJECTURI
http://dotps1.github.io
.NOTES
Slight modifications by Nick
#>

Function Test-Credential {
[OutputType([Bool])]

Param (
[Parameter(
Mandatory = $true,
ValueFromPipeLine = $true,
ValueFromPipelineByPropertyName = $true
)]
[Alias('PSCredential')]
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,

[Parameter()]
[String]
$Domain = $Credential.GetNetworkCredential().Domain
)

Begin {
[System.Reflection.Assembly]::LoadWithPartialName("System.DirectoryServices.AccountManagement") |
Out-Null

$principalContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext(
[System.DirectoryServices.AccountManagement.ContextType]::Domain, $Domain
)
}

Process {
foreach ($item in $Credential) {
$networkCredential = $Credential.GetNetworkCredential()

Write-Output -InputObject $(
$principalContext.ValidateCredentials(
$networkCredential.UserName, $networkCredential.Password
)
)
}
}

End {
$principalContext.Dispose()
}
}
18 changes: 18 additions & 0 deletions AD/Update-ADMFARegistrationGroup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Import-Module ActiveDirectory

# Get all MSO users and their MFA status, convert into AD users
$MFAUsers = . "MSO\Get-MFAEnabledUser.ps1"
$RegisteredUsers = $MFAUsers | Where-Object -Property DefaultMethod -NE $null | ForEach-Object {
Get-ADUser -Filter "UserPrincipalName -eq '$($_.UserPrincipalName)'"
}

# Get the group that holds unregistered MFA users and the users within
$UnregisteredGroup = Get-ADGroup -Identity 'MFA Registration Incomplete'
$UnregisteredUsers = $UnregisteredGroup | Get-ADGroupMember | Get-ADUser

# Find users in the group that have a default MFA method
$UsersToRemove = $UnregisteredUsers | Compare-Object -ReferenceObject $RegisteredUsers -IncludeEqual |
Where-Object -Property SideIndicator -eq '=='

# Remove users with a default MFA method
Remove-ADGroupMember -Identity $UnregisteredGroup -Members $UsersToRemove.InputObject
7 changes: 7 additions & 0 deletions Application Management/Get-AADConnectVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$Creds = Get-Credential
$DirSyncServer = 'dirsync01'

Invoke-Command -ComputerName $DirSyncServer -Credential $Creds -ScriptBlock {
$RegKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
Get-ItemProperty -Path $RegKey | Where-Object -Property DisplayName -EQ 'Microsoft Azure AD Connect'
} | Select-Object -Property DisplayName, PSPath, Version, DisplayVersion | Format-List
41 changes: 41 additions & 0 deletions CaseWare/New-CWSyncServer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function New-CWSyncServer {
<#
.DESCRIPTION
Add SmartSync server to CaseWare Working Papers.

.PARAMETER HostName
Host name of SmartSync server.

.PARAMETER Label
Friendly name of SmartSync server as it will appear in CaseWare Working Papers.

.EXAMPLE
New-CWSyncServer site01.company.com

.NOTES
Created by Nick Rodriguez
Adds new SmartSync server to registry that will appear in CaseWare Working Papers.
#>
[CmdletBinding(SupportsShouldProcess = $true)]
Param(
[Parameter(Mandatory = $true)]
[String]
$HostName,

[Parameter(Mandatory = $false)]
[String]
$FriendlyName
)

# Create the site key
$RegPath = 'HKCU:\SOFTWARE\CaseWare International\Working Papers\*\SyncServer'
if (-not (Test-Path -Path "$RegPath\{$HostName}")) { New-Item -Path $RegPath -Name "{$HostName}" }

# Set the two site key properties
Set-ItemProperty -Path "$RegPath\{$HostName}" -Name Host -Value $HostName
Set-ItemProperty -Path "$RegPath\{$HostName}" -Name Label -Value $FriendlyName

# Validate with SCCM friendly exit codes
$SiteKey = Get-ItemProperty -Path "$RegPath\{$HostName}"
if ($SiteKey.Host -eq $HostName -and $SiteKey.Label -eq $FriendlyName) { exit 0 } else { exit 999 }
}
Loading