When working with Power Automate recently I was struggling being able to get the Teams and Channel IDs but with a bit of Googling I managed to work out how to obtain this information. So all that is required is the following expressions created under Data Operation
Over the coming weeks I am going to be doing Power Automate post to demostrate the ability to automate workloads within Microsoft 365. Today, I am going look at configuring an Approval process for the creation of a Microsoft Teams Channel
Configuring a SharePoint List
I am no expert when it comes to SharePoint but any expert in “Share Pint” as how does love a good drink now and then. So back on topic within your SharePoint Online Site you need to create a new list as shown in the image below.
Give your SharePoint List a name and description for future reference.
As you can see from the below, I have create a number of columns to capture the information I would like to include into the approval process.
Column Name
Column Type
Title
Title used for the Channel Name.
Team Name
Name of the Microsoft Team
Description
Description of the new Channel
Justification
Justification for the request
Configuring Power Automate
Create a new Flow from the SharePoint List > Automate > Power Automate > See your Flows
Click New > Automated from blank. Provide a Flow name, i.e. “Request – New Microsoft Teams Channel Provisioning”,
Select your Site Address and List Name as shown below.
Modify the Start an approval in line with your requirements, for this post I have included the layout I have created for my own tenant.
We now need a Data Operation in order to gather the Teams ID which is required to identify the Teams where the channel will be created.
Create Filter array which looks at the Teams List based on the Team Name against the entry in the SharePoint List.
Next step is to create a channel with uses the apply to each array.
We have now completed the flow, so let’s go and create the request. As shown below.
This will now generate a request to create the team channel automatically in the background and as you can see all the new Project Channels have been created.
Did you know that when creating Office 365 Groups from different locations impacts on what will be created and made available. I have put together a quick reference table which shows what is and isnt created. I have been recently working with a customer who couldnt understand why one of the features was not available after creating a new Office 365 Group.
Creating From:
Creates
Doesnt Create
SharePoint
SharePoint Site Shared Mailbox Shared Calendar Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace
Microsoft Teams Team (Can be added afterwards) Planner Plan (Can be added afterwards) Yammer Feed
Outlook
SharePoint Site Shared Mailbox Shared Calendar Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace
Microsoft Teams Team (Can be added afterwards) Planner Plan (Can be added afterwards) Yammer Feed
Stream
SharePoint Site Shared Mailbox Shared Calendar Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace
Microsoft Teams Team (Can be added afterwards) Planner Plan (Can be added afterwards) Yammer Feed
Planner
SharePoint Site Shared Mailbox Shared Calendar Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace Planner Plan
Microsoft Teams Team (Can be added afterwards)
Yammer Feed
Microsoft Teams
SharePoint Site Shared Mailbox Shared Calendar Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace Microsoft Teams Team
Planner Plan (Can be added afterwards) Yammer Feed
Yammer
SharePoint Site Stream Video Portal Power BI Workspace OneNote Notebook Microsoft Forms Workspace Yammer Feed
Microsoft Teams Team Planner Plan (Can be added afterwards) Shared Mailbox Shared Calendar
While running the Exchange Hybrod Configuration Wizard I ran in the following issue;
HCW8078 – Migration Endpoint could not be created Microsoft.Exchange.Migration.MigrationServerConnectionFailedException The connection to the server ‘http://mail.domain.com’ could not be complete
This issue is a known issue to Microsoft and the resolution is the good old “Have you tried turning it off and on?”
http://gph.is/15qgSlN
The resolution was to Disable MRSProxyEnabled, this can be easily completed for all servers using;
This script will need to repeat this process for all your servers where MRSProxy is being used. Invoke-Command -ComputerName Server1 -ScriptBlock {iisreset /restart}
Once you have completed the below steps you will be able to successful rerun the Hybrid Configuration Wizard without any errors
PowerShell is one of the greatest tools within any IT Professional toolkit, it enables you to do far more than any GUI available to you today. In my life as a Consultant for a Global Microsoft SI (System Integrator), I face challenges every day where PowerShell has come to the rescue. One of the best cmdlet I use in a lot of script is
ForEach which is the alias name of ForEach-Object
Imagine you need to modify an ExtensionAttribute for your entire organization or grant a permission to a subset of users, ask yourself this? How would I do this in a GUI? and the answer would be “with great difficulty or very time consuming”. This is Foreach-Object comes into play, in the below example I need to modify the PrimarySMTPAddress due to special characters being used
Get-DistributionGroup
In order to correct this, I will be using a source CSV file which contains SamAccountName for the identity of each DistributionList and the correct PrimarySMTPAddress.
Source CSV file
Now for the most important element, the powershell script which will be used to modify the PrimarySMTPAddress. The below script has been designed to achieve the required outcome but also includes the ability to;
Be ran using native PowerShell for On-Premises Exchange Servers (2007 through to 2019)
Be ran against Exchange Online
So as we can see the Foreach command is being used in the following;
For each $row within the $csv which is being imported try and get the distribution list using the column heading SamAccountName
If the Identity cannot be found the script will move to the catch
If the Identity can be found the script will set the distribution list using the column heading PrimarySMTPAddress
The catch is alert if there are any unsuccessful attempts at setting the PrimarySMTPAddress
Simples!!
Clear-Host $file = "$env:USERPROFILE\OneDrive\Desktop\groups.csv" $csv = import-csv -Path $file region Exchange Module SnapIn # Exchange 2007 #Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin; # Exchange 2010 #Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; # Exchange 2013/2016 #Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; endregion Transcript Start-Transcript -Path $env:USERPROFILE\OneDrive\Desktop\Get-DistributionGroup.txt Foreach ($row in $csv) { try { Get-DistributionGroup -Identity $row.SamAccountName | Set-DistributionGroup -PrimarySmtpAddress $row.PrimarySmtpAddress Write-Host 'INFO:' ($row.SamAccountName),'Primary SMTP Address has now been modified to',($row.PrimarySmtpAddress) -BackgroundColor Green } catch { Write-Host 'ERROR:' ($row.SamAccountName),'Primary SMTP Address has not been modified to',($row.PrimarySmtpAddress) -BackgroundColor Red } } Stop-Transcript Get-DistributionGroup
I have included Start-Transcript as this will dump out all Write-Host entry whether they was successful or not.
When working with on-premises Exchange there may be a requirement to create a PowerShell script using PowerShell ISE. Even if you run ISE on a Exchange Server, you are unable to get the Exchange cmdlets in ISE. So whats theworkaround for this is?
Important: Getting Exchange Cmdlets on a client machine
If you are trying to add the Exchange cmdlets to your client machine then you will need to Install the Exchange Management Tools from the Exchange installation media on your device.
Importing the Exchange Cmdlets into PowerShell ISE
The following commands allow the import of the Exchange Management Cmdlets into PowerShell ISE. They are slight different for the listed versions of Exchange.
Exchange 2007
Use the following Add-PSSnapin to bring the cmdlets into PowerShell ISE
Have you ever wondered how long it took to run your script? Well, you dont need to wonder anymore. The following couple of lines will provide a visual output how long it take to execute your script from start to finish
When working with Active Directory Users sometimes its a lot easier using PowerShell to obtain all the information you require from your environment. As a Consultant I have lost count how many times I’ve used PowerShell to get information out of Active Directory and its essential to your skill set.
The most simple and effective way by running the following command, as it will dump all Active Directory Users and their properties to a CSV file located on your desktop
The possibilities are endless, you can call all everything from the below table because it exists on the AD object by default. If you have used ExtensionAttributes or CustomAttributes you can also call these as well by adding them to your filter.
Property
Syntax
R/RW
lDAPDisplayName
AccountExpirationDate
DateTime
RW
accountExpires, converted to local time
AccountLockoutTime
DateTime
RW
lockoutTime, converted to local time
AccountNotDelegated
Boolean
RW
userAccountControl (bit mask 1048576)
AllowReversiblePasswordEncryption
Boolean
RW
userAccountControl (bit mask 128)
BadLogonCount
Int32
R
badPwdCount
CannotChangePassword
Boolean
RW
nTSecurityDescriptor
CanonicalName
String
R
canonicalName
Certificates
ADCollection
RW
userCertificate
ChangePasswordAtLogon
Boolean
W
If pwdLastSet = 0
City
String
RW
l
CN
String
R
cn
Company
String
RW
company
Country
String
RW
c (2 character abbreviation)
Created
DateTime
R
whenCreated
Deleted
Boolean
R
isDeleted
Department
String
RW
department
Description
String
RW
description
DisplayName
String
RW
displayName
DistinguishedName
String (DN)
R
distinguishedName
Division
String
RW
division
DoesNotRequirePreAuth
Boolean
RW
userAccountControl (bit mask 4194304)
EmailAddress
String
RW
mail
EmployeeID
String
RW
employeeID
EmployeeNumber
String
RW
employeeNumber
Enabled
Boolean
RW
userAccountControl (bit mask not 2)
Fax
String
RW
facsimileTelephoneNumber
GivenName
String
RW
givenName
HomeDirectory
String
RW
homeDirectory
HomedirRequired
Boolean
RW
userAccountControl (bit mask 8)
HomeDrive
String
RW
homeDrive
HomePage
String
RW
wWWHomePage
HomePhone
String
RW
homePhone
Initials
String
RW
initials
LastBadPasswordAttempt
DateTime
R
badPasswordTime, converted to local time
LastKnownParent
String (DN)
R
lastKnownParent
LastLogonDate
DateTime
R
lastLogonTimeStamp, converted to local time
LockedOut
Boolean
RW
msDS-User-Account-Control-Computed (bit mask 16)
LogonWorkstations
String
RW
userWorkstations
Manager
String (DN)
RW
manager
MemberOf
ADCollection
R
memberOf
MNSLogonAccount
Boolean
RW
userAccountControl (bit mask 131072)
MobilePhone
String
RW
mobile
Modified
DateTime
R
whenChanged
Name
String
R
cn (Relative Distinguished Name)
ObjectCategory
String
R
objectCategory
ObjectClass
String
R
objectClass, most specific value
ObjectGUID
Guid
R
objectGUID converted to string
Office
String
RW
physicalDeliveryOfficeName
OfficePhone
String
RW
telephoneNumber
Organization
String
RW
o
OtherName
String
RW
middleName
PasswordExpired
Boolean
RW
msDS-User-Account-Control-Computed (bit mask 8388608) (see Note 1)