How Microsoft Purview DLP currently can help you protect confidential data in Copilot.

Organizations today face a difficult balancing act. Business leaders are eager to adopt tools like Microsoft Copilot to unlock productivity and innovation. Meanwhile, IT and security teams are concerned about safeguarding sensitive information, especially as AI-driven features process vast amounts of organizational data. This tension is real: enabling advanced capabilities without compromising compliance or data protection is a challenge every modern enterprise must solve. Microsoft Purview Data Loss Prevention (DLP) is a key solution to this problem. It provides mechanisms to prevent confidential data from being exposed or misused, even in scenarios involving AI. I want to highlight two features designed to help organizations in controlling what is being processed by Copilot. Blocking Documents Based on Sensitivity Labels One of the foundational features of Purview DLP is its ability to enforce policies based on Microsoft Information Protection sensitivity labels. If your organization...

What to do when AD phone property is formatted wrong.

In my previous post, I just showed you how to search for a security group in AD, and set cs-user properties based on the selection of users.

My script is based on these users having 100% correct formatted phone attribute in Active Directory. But as some of you already know, that might not be the case. Some have formatted their phone numbers with spaces like this: +47 22 22 22 22, some might have used other characters like this +1 (454) 123 4567 and others might not have the proper E.164 international formatting and have left out their international code: (202) 123 4567.

Fear not, I will tell you how to handle this (as long as they all have the same "error" in their syntax).

If you look at the following command:

Get-ADGroup -Identity TestGroup | Get-ADGroupMember -verbose | foreach {get-csaduser -identity $_.Name | foreach {
$sipit = $_.phone
$sipit = "tel:" + $sipit
Set-CsUser -Identity $_.Name -EnterpriseVoiceEnabled $true -LineURI $sipit -PassThru | Grant-CsClientPolicy -PolicyName restrict}}

You can see we grab the "phone" attribute and populate it into a variable I have called $sipit. Then I add the "tel:" to the already existing $sipit variable. After this, the output of $sipit is "tel:-whateverwasinthephoneattrib". If the phone attrib is wrongly formatted, we need to alter this before we add the "tel:". We can do this using the -replace command. And I will sow you two examples of how to do this.

1)

Get-ADGroup -Identity $groupfetch | Get-ADGroupMember -verbose | foreach {get-csaduser -identity $_.Name | foreach {
$sipit = $_.phone
## Next line will remover anythin in the string that is not a number (including +, spaces, () and more)
$sipit = $sipit -rplace "[^0-9]"
## Next line is slightly modified to add the + back into the phone number
$sipit = "tel:+" + $sipit
Set-CsUser -Identity $_.Name -EnterpriseVoiceEnabled $true -LineURI $sipit -PassThru | Grant-CsClientPolicy -PolicyName restrict}}

Given the command above you would take a number like this +1 (234) 567 8900, or this: +1 234 5678900 and turn them into the correct lineURI format tel:+12345678900.

2)
Just as an example, I'll show how to add the national prefix if this is not present in the AD property:

Get-ADGroup -Identity $groupfetch | Get-ADGroupMember -verbose | foreach {get-csaduser -identity $_.Name | foreach {
$sipit = $_.phone
## Next line will remover anythin in the string that is not a number (including +, spaces, () and more)
$sipit = $sipit -rplace "[^0-9]"
## Next line is slightly modified to add the + and the international prefix into the phone number
## I used the North American code +1 in the example. You use whatever you need to in your deployment.
$sipit = "tel:+1" + $sipit
Set-CsUser -Identity $_.Name -EnterpriseVoiceEnabled $true -LineURI $sipit -PassThru | Grant-CsClientPolicy -PolicyName restrict}}

Quite simple, and a very quick way to enable telephony for your users. have fun labbing, and please let me know what you think about these posts.

If you need more power shell commands for Lync, I can really recommend the Lync Powershell Blog  They have a great collection of examples.