Find and Replace Multiple Values at Once with VBA Code
If you are tired of find and replace the values time and time again, the following VBA code can help you to replace multiple values with your needed texts at once.
1. Please create your conditions that you want to use which contain the original values and new values. See screenshot:
2. Then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications wSome readersAdd Team user using Powershell and CSV
Description:
This script is used to add members and owners in Teams
The following columns are required in the CSV:
-GroupID: GroupID of the Team
-User: Email of the user
-Role: Owner or members
Script:
Install-Module -Name MicrosoftTeams
Connect-MicrosoftTeams
Import-Csv -Path " C:UsersAwaisOneDrive - Communication SquareDesktopteams.csv" foreach Add-TeamUser -GroupId $.GROUPID -user $.upn -Role $.RoleSome readersGet the Team Owners For All The Teams Using PowerShell
Description:
This script is used to get details of all owner of the Teams
Script:
Get the credentials
$credentials=Get-Credential
Connect to Microsoft Teams
Connect-MicrosoftTeams -Credential $credentials
Get all the teams from tenant
$teamColl=Get-Team
Loop through the teams
foreach($team in $teamColl)
Write-Host -ForegroundColor Magenta "Getting all the owners from Team: " $team.DisplayName
Get the team owners
$ownerColl= Get-TeamUser -Some readersHow to generate and export Active Directory (AD) user reports that contain the display names of their managers
Description:
This script is used to get CSV file which contain all the user in the On-Prem AD and their Manager
Script:
import-module activedirectory
Get-ADUser -Filter * -Properties *Select name, @ n='Manager';e= (Get-ADUser $.manager).name export-csv "c:export.csv" -NoTypeInformationFew readersAdding Channels to Microsoft TeamsUsing CSV
Description:
This script is used to add multiple Channels in the Teams at once.
For Example:
You need to add multiple Channels in Marketing Team
To achieve this you need to create a CSV file which contain 2 columns
-GroupID: This is the ID of the Team where you want to add channels
-DisplayName: This is the name of the channel i.e. Budget
Script:
Install-ModulFew readersHow to Connect to the Microsoft 365 Powershell
How to Connect to the Microsoft 365 Powershell
Open an elevated Windows Power Shell Comm and Prompt window (run Windows Power Shell as an administrator).
Step 1: Run this command:
Install-Module -Name Azure AD
Step 2: Connect to Azure AD for your Microsoft 365 subscription
To connect to Azure Active Directory (Azure AD)foryourMicrosoft365run this command from a Windows PoweFew readersAdding new Teams in Microsoft Teams using Powershell
Description:
This script is used to add new teams in Microsoft Teams using powershell and CSV file.
Required Columns in CSV file:
-DisplayName: Name of the Team
Script:
Install-Module -Name MicrosoftTeams
Connect-MicrosoftTeams
Import-Csv -Path "C:UsersawaisOneDrive - Communication SquareDesktopteams.csv" foreach New-Team -DisplayName $.Team -Owner $.Owner -Visibility $.TeamVisibilityFew readersGet Details of members of all Groups Present in Office 365 Tenant
Description:
This script is used to get all Groups, Group Members and save into CSV
Script:
Install-Module -Name AzureAD
Connect-AzureAD
Install-Module -Name Msonline
Connect-MsolService
$OutputFile = Read-Host -Prompt "Enter the path and file name for the .csv file eg. C:usersAwaisdesktopfilename.csv"
Out-File -FilePath $OutputFile -InputObject "Group DisplayName, Group Email, Member DisplayName, Member Email" -Encoding UTF8
$objGroups = Get-msolgroup -All Sort-obFew readersCreate Bulk users in office 365 tenant using CSV and Powershell
Description:
This script is used to create bulk user in office 365 using a CSV file and Powershell
The following columns are required in the CSV:
-DisplayName: Name of the User
-FirstName: First name of the user
-LastName: Last name of the user
-UserprincipalName: Required Email address of the user
-UsageLocation: Location of the User
-LicenseAssignment: SkuID of the required license
-Password: Password of the user
-City: City of the user
-Title: Job Title
-Office: Office
-DepaFew readersCreate multiple Unified Groups using CSV file
This script is used to create unified groups(For Exchange) using a CSV file
This script use CSV file which sould contain the following columns:
-DisplayName: Name of the unified group
-EmailAddresses: Emails of the Unified Groups
-AccessType: Public or Private
-Owner: Owner of the Unified Group
-Members: Member of the Unified group (please see other article on our how to's section which explains how to add members in already present unified groups)
Script:
Install-Module -Name AzureAFew readersRemove team member from the Microsoft Teams
Description:
This script is used to remove members and owners in Teams
The following columns are required in the CSV:
-GroupID: GroupID of the Team
-User: Email of the user
-Role: Owner or members
Note: If you remove an owner from a team he will still be a member of the Team
Script:
Install-Module -Name MicrosoftTeams
Connect-MicrosoftTeams
Import-Csv -Path " C:UsersAwaisOneDrive - Communication SquareDesktopteams.csv" | foreach
Remove-TeamUser -GroupId $.GROUPID -UserFew readersGet owner of MSOL Groups (Security, Distribution List, MailEnabledSecurity)
Description:
This script is used to get owner (Managed by property) of the Office 365 Groups.
-You can change the value of Grouptype
-Security
-Distribution List
-MailEnabledSecurity
You will get output something like that:
Script:
Install-Module -Name AzureAD
Connect-AzureAD
Install-Module -Name Msonline
Connect-MsolService
Get-MsolGroup -GroupType Security seFew readersEdit MSOL user details using CSV and Powershell
Description:
This script is used to edit the multiple user parameters at once using CSV file and Powershell
For Example:
A office365 tenant has 1000's of user and you need to update their usage location their title.
You need to create a CSV file which contain the following columns
-UPN of the user of whom you want to edit the details
-Usage Location: New usage Location
-Title: New title
Script:
Install-Module -Name Msonline
Connect-MsolService
Import-Csv -Path "C:UsersAFew readersDisable Self-Service Microsoft Teams Creation in Office 365
Description:
About Microsoft Teams governance, you probably need/want to prevent normal users from new Teams creation.
This can be achieved only with a PowerShell script because, right now, standard Office 365 UI do not give us this option.
Important: in order to be able to execute the script you need the Preview of AzureAD module for PowerShell. This is called "AzureADPreview".
If you already have installed production AzureAD module, you need to uninstall it and then install new previeFew readersBulk Password Reset of office 365 users
Description:
This script is used to reset password of office 365 users using powershell and CSV file.
In the CSV you need to create the following columns:
-UserprincipalName: Email of the user whose password you want to reset
-NewPassword: New password you want to set for the user
-ForceChangePassword: User force to change password on first login
Script 1:
Import-Csv -Path "C:UsersAwaisDesktopDrivers.csv" foreach
$users = get-msoluser select userprincipalname,objectid wFew readersUsing PowerShell to generate report of all Azure AD users with Manager
Description:
This script is used to get all the Azure AD user's and their Managers
Script:
Install-Module -Name AzureAD
Connect-AzureAD
Install-Module -Name Msonline
Connect-MsolService
Install-Module -Name MicrosoftTeams
Connect-MicrosoftTeams
$output = @()
$users = Get-AzureADUser -All $true
foreach ($user in $users)
$manager = Get-AzureADUserManager -ObjectId $user.ObjectId
$data = New-Object -TypeName psobject
$data Add-Member -MemberType NoteProperty -NamFew readersAdd members to Unified Groups using CSV
Acommsqadmin@stpud.usDescription:
This script is used to add members to the unified groups using CSV File.
The CSV file should contain the following columns:
-Identity: Identity parameter specifies the Microsoft 365 Group that you want to modify. (Name, DN, email any one of these which should be unique)
-LinkType: The LinkType parameter specifies the Microsoft 365 Group property that you want to modify. (Member, Owner, Subscriber)
-Links: The Links parameter specifies the recipients toFew readers