Posts tagged with "User-Management"

Active Directory User Lockout and Password Report

A PowerShell script that generates an HTML diagnostics report for user lockouts in Active Directory, including password age, expiration details, and account status.

Published: May 30, 2024 | Last Modified: May 13, 2025

Managing Global Address List (GAL) Visibility with PowerShell

A comprehensive guide to managing user visibility in the Global Address List (GAL) using PowerShell, covering both on-premises Active Directory and Exchange Online environments with detailed scripts for checking and modifying the msExchHideFromAddressLists attribute.

Published: April 5, 2023 | Last Modified: May 13, 2025

Microsoft Teams PowerShell Management Guide

PowerShell scripts for Microsoft Teams stuff.

Get all owners of all teams and team channels

## Documentation: https://learn.microsoft.com/en-us/powershell/module/teams/?view=teams-ps
 
# Run the following command to install the latest PowerShellGet:
Install-Module -Name PowerShellGet -Force -AllowClobber
 
# Install the Teams PowerShell Module.
Install-Module -Name MicrosoftTeams -Force -AllowClobber
 
# To start working with Microsoft Teams PowerShell module, sign in with your Azure credentials.
Connect-MicrosoftTeams
 
$user =Read-Host -Prompt 'Input the user name'
$teams = Get-Team -User $user
$teamMemberships=@()
$teamChannels=@()
$teamChannelMemberships=@()
 
$i = 1

$teamMemberships = foreach ($team in $teams) {
    $GroupId = $team.GroupId   
    
    Get-TeamUser -GroupId $GroupId | Select-Object *,@{Name="GroupId";Expression={$GroupId}}
    $channels = Get-TeamAllChannel -GroupId $GroupId | Select-Object *,@{Name="GroupId";Expression={$GroupId}}
    $teamChannels += $channels

    $teamChannelMemberships += foreach ($channel in $channels) {
        $channelDisplayName = $channel.DisplayName
        Get-TeamChannelUser -GroupId $GroupId -DisplayName $channelDisplayName | Select-Object *,@{Name="GroupId";Expression={$GroupId}}
    }

    $percent = [Math]::Round((100 * $i) / $teams.Length)
    Write-Progress -Activity "Search in Progress" -Status "$percent% complete"
    $i++
    }

$teams | Export-Csv -Path "teams.csv" -NoTypeInformation
$teamMemberships | Export-Csv -Path "team-memberships.csv" -NoTypeInformation
$teamChannels | Export-Csv -Path "team-channels.csv" -NoTypeInformation
$teamChannelMemberShips | Export-Csv -Path "team-channel-memberships.csv" -NoTypeInformation

Published: February 23, 2023 | Last Modified: May 13, 2025

Managing Windows User Accounts with net user Command

The “net user” command is a Command Prompt (Shell) command used to manage user accounts on a Windows operating system. It can be used to create, modify, or delete user accounts, as well as to change passwords and manage group memberships.

Syntax

net user [username [password | *] [options]] [/DOMAIN]
net user username {password | *} /ADD [options] [/DOMAIN]
net user username [/DELETE] [/DOMAIN]
net user username [/TIMES:{times | ALL}]
net user username [/ACTIVE: {YES | NO}]

Add a user

To add a new user account:

Published: February 22, 2023 | Last Modified: May 13, 2025