Archive for the ‘Uncategorized’ Category
SharePoint PowerShell to identify all OneDrive sites and migrate content to SharePoint sites
I wanted to perform migration of few of my users content to their respective OneDrive site. To do so, I used below PowerShell to identify URL of all users who already have a OneDrive sites and then used FileMigration wizard to import their content in the respective OneDrive Site.
$TenantUrl = Read-Host "https://tenantname-admin.sharepoint.com/"
$LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log"
Connect-SPOService -Url $TenantUrl
Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select -ExpandProperty Url | Out-File $LogFile -Force
Write-Host "Done! File saved as $($LogFile)."

Note : Note agent should be installed on a system which should have access to the files through network drive we want to migrate








PowerShell to find duplicate files on SharePoint online site
You can use below PowerShell to find all duplicate files(regardless of document libraries) on SharePoint online site.
Make sure you update the parameters such as SiteURL and ReportOutput. This may take time based on number of items in SharePoint site. I have kept it running for 3 days and it worked like a charm. I have seen other Powershell’s which don’t work if you have MFA enabled whereas this script works regardless you have MFA enabled or disabled.
#Before running the below script, kindly follow below steps :
#1. Open you PowerShell ISE in your system and run it as administrator
#cls2. Install the New PnP PowerShell Module using below commands:
Install-Module PnP.PowerShell
#3. Register a new Azure AD Application and Grant Access to the tenant
Register-PnPManagementShellAccess
#Then paste and run below pnp script:
#Parameters
$SiteURL = "https://tenantname.sharepoint.com/sites/Sitename"
$Pagesize = 2000
$ReportOutput = "C:\Temp\Sitename.csv"
#Connect to SharePoint Online site
Connect-PnPOnline $SiteURL -Interactive
#Array to store results
$DataCollection = @()
#Get all Document libraries
$DocumentLibraries = Get-PnPList | Where-Object {$_.BaseType -eq "DocumentLibrary" -and $_.Hidden -eq $false -and $_.ItemCount -gt 0 -and $_.Title -Notin("Site Pages","Style Library", "Preservation Hold Library")}
#Iterate through each document library
ForEach($Library in $DocumentLibraries)
{
#Get All documents from the library
$global:counter = 0;
$Documents = Get-PnPListItem -List $Library -PageSize $Pagesize -Fields ID, File_x0020_Type -ScriptBlock `
{ Param($items) $global:counter += $items.Count; Write-Progress -PercentComplete ($global:Counter / ($Library.ItemCount) * 100) -Activity `
"Getting Documents from Library '$($Library.Title)'" -Status "Getting Documents data $global:Counter of $($Library.ItemCount)";} | Where {$_.FileSystemObjectType -eq "File"}
$ItemCounter = 0
#Iterate through each document
Foreach($Document in $Documents)
{
#Get the File from Item
$File = Get-PnPProperty -ClientObject $Document -Property File
#Get The File Hash
$Bytes = $File.OpenBinaryStream()
Invoke-PnPQuery
$MD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$HashCode = [System.BitConverter]::ToString($MD5.ComputeHash($Bytes.Value))
#Collect data
$Data = New-Object PSObject
$Data | Add-Member -MemberType NoteProperty -name "FileName" -value $File.Name
$Data | Add-Member -MemberType NoteProperty -Name "HashCode" -value $HashCode
$Data | Add-Member -MemberType NoteProperty -Name "URL" -value $File.ServerRelativeUrl
$Data | Add-Member -MemberType NoteProperty -Name "FileSize" -value $File.Length
$DataCollection += $Data
$ItemCounter++
Write-Progress -PercentComplete ($ItemCounter / ($Library.ItemCount) * 100) -Activity "Collecting data from Documents $ItemCounter of $($Library.ItemCount) from $($Library.Title)" `
-Status "Reading Data from Document '$($Document['FileLeafRef']) at '$($Document['FileRef'])"
}
}
#Get Duplicate Files by Grouping Hash code
$Duplicates = $DataCollection | Group-Object -Property HashCode | Where {$_.Count -gt 1} | Select -ExpandProperty Group
Write-host "Duplicate Files Based on File Hashcode:"
$Duplicates | Format-table -AutoSize
#Export the duplicates results to CSV
$Duplicates | Export-Csv -Path $ReportOutput -NoTypeInformation
What is digital twin? – Part 2
Now lets understand when you should use Digital twin:
- You should use it when you have large number of digital twin to manage
- When there is complexity in relationship
- It would be best if you can existing model instead of creating new once
- You can benefit if it has flexible schema
Couple of things which popularized digital twin in recent days:
- Cheap IOT devices
- Increased number of IOT devices in use
- Affordable internet/connectivity
- Boost in Cloud platforms
If you want to implement Digital Twin, you need to make sure your projects have below characteristics:
- Ability to establish some sort of connection between 2 devices
- Can and should require queries to be executed based on device parameters
- Secure integration
Lets try to build a Digital twin of a Building to understand what is temperature of each room.
In Azure Digital Twin, we have 4 types of interfaces or classes
- Component – Temperature and humidity
- Relationship – Building has floor and then floor has rooms
- Telemetry – Input data
- Properties – State of entity
You can download the json from MS link below:
Building : https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Building.json
Floor : https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Floor.json
Room : https://raw.githubusercontent.com/Azure-Samples/digital-twins-explorer/main/client/examples/Room.json


Here Json needs to start with dtmi with displayname as ‘Building’, next the only property of this interface is Date, It has relationship with Floor. Most important is DisplayName.

Here Json needs to start with dtmi with displayname as ‘Floor’, next properties of this interface is OwnershipUser and OwnershipDeparment, It has relationship with Room

Here Json needs to start with dtmi with displayname as ‘Room, next the only property of this interface is Temperature and Humidity, It has no further relationship
Make sure you use DTDL validator while creating these Json files
https://learn.microsoft.com/en-us/samples/azure-samples/dtdl-validator/dtdl-validator/
Using this json we have multiple ways to create our scenario’s but we will use below xlsx file which has specified data to start with. You can download the excel for building scenario’s from below path:
https://github.com/Azure-Samples/digital-twins-explorer/raw/main/client/examples/buildingScenario.xlsx



Microsoft understands it will take a lot of efforts for one to create these models and relationships, so to ease the process Microsoft has published a few models such as space, event, document, building, etc so you can reuse them as your start point
https://github.com/WillowInc/opendigitaltwins-building
Here is basic strcture of Azure Digital Twin

Input : Input can be from Workflows, IOT hub or any rest Api. You can input parameter data manually as well.
Processing : Azure Digital Twin platform process the input based on business logics, understands connections and process data accordingly. Digital twin of real-world sensors can be created to predict and test results based on change in inputs
Output : Using Time Series insights, Azure data explorer and Analytics we can better visualize data and actionable items can be driven from predictions.
Main challenges with ADT are:
- Modelling is difficult and time consuming
- Delay in processing data realtime
- Inter operability between different types of IOT devices and services
- Hard and expensive for existing systems
- Privacy and confidentiality
ChatGPT is back with new Avatar, Try new Bing
If you are looking for a new way to search the web, you should check out the new Bing. The new Bing is more than just a search engine. It’s a chat partner that can answer your questions, provide complete information and even inspire your creativity.
The new Bing uses ChatGPT AI technology to give you better results for simple things like sports scores, stock prices and weather . But it also shows you more detailed answers if you want them . You can chat with Bing in natural language, do complex searches, follow up and make refinements. You’ll be surprised by how well Bing understands you and responds to your needs.
But that’s not all. The new Bing also helps you unleash your creative potential with features like poems, stories, code, essays, songs and celebrity parodies. You can ask Bing to create any of these for you based on your keywords or preferences. You can also edit and share them with others.
The new Bing also works seamlessly with Microsoft Edge, your copilot for the web. Edge gives you access to exclusive features like Collections, Immersive Reader and Vertical Tabs that help you organize your browsing experience. You can also sync your bookmarks, passwords and settings across devices with Edge.
Don’t miss out on the new Bing. Go to bing.com/new and start exploring the possibilities. The new Bing is here to help you find what you need and have fun along the way.
What is digital twin? – Part 1
What is digital twin?
Virtual representation of real world item or process.
Digital twin platform enables us to actually collect this data, process it, provide insights and then enable us to take some actions based on the data. More specifically take proactive measures instead of reactive measures. General its used for items but we can also use it for processes. I will explain on how we can use digital twin for processes.
What are types of Twin?
- Digital Model/Simulator: Here we manually feed data into a existing model to see its results. If we have seen the movie ‘Day After Tomorrow’, the scientist inputs data from various locations in the existing model and can predict what the world would go through in next few days.
- Digital Shadow: Here real world devices/sensors send IOT data to virtual platform. Lets assume we have a physical car and a wheels in your car has a sensor wheel which is sending data to the a cloud based digital twin wheel (Virtual representation of car). This will help understand when your car tires needs to be replaced or repaired. A real life example is Michelin Fleet Solutions.
- Digital Twin: Here we have 2 way data sync from sensor to the digital twin and may receive some action based on input provided. Example here is where we have a multistory warehouse which has sensor on all most critical components, water supply, electricity circuit, elevators, co2 level, AC etc. Based on feedback of the sensors, temperature(Cold storage) in one section of the warehouse is different and other section(Meeting room).
Typical Digital Twin functions
- Visualize current state of item or process
- Trigger alerts under certain conditions
- Review historic data
- Simulate scenarios
Few Benefits:
- Helps save money incase we go live/production with a major defects or avoid downtime at all.
- Learn from past scenarios.
- Help increase safer work environment.
- Increase Quality / efficiency / life of the products/organization.
How are digital twin used in real world?
As I have already shared, Michelin Fleet Solutions now sells kilometers instead of tyres to make profit and sensor in wheel of car is sending data to the a cloud based digital twin wheel (Virtual representation of car).This will help understand when your car tires needs to be replaced or repaired. Also they provide feedback to customer on which routes to take and what time to travel to avoid reduce lifespan of the wheels.
Another example is where a supermarket monitors all the customers as to which section they visit most, which is most visible section for adds, how many people buy what kind of items from check out counters, etc. This helps them to place new products / high margin products in that area with high footprint and also plan a longer exit path so because physiologically, the more time a person spends in the store, the more he would purchase.
Origins of digital twin
John Vickers who was Principal technologies invented the word digital twin back in 2010.
Michael Grieves then worked with Vickers to create digital twin of few real life items. It got boost after IOT growth accelerated.
One of the best example is Digital Twin Victoria(Australia)
Permission or URL issue when you use Azure Digital Twin explorer for the 1st time



Error : ‘Double check URL and directory’ or ‘you don’t have permission on the Digital twin URL’
RestError: Sub-domain not found.
at new t (https://explorer.digitaltwins.azure.net/static/js/465.196a83e5.chunk.js:2:21103219)
at https://explorer.digitaltwins.azure.net/static/js/465.196a83e5.chunk.js:2:21108505
at https://explorer.digitaltwins.azure.net/static/js/465.196a83e5.chunk.js:2:21109190
To resolved these errors follow below steps
- In the Azure portal, navigate to the Digital Twins resource
- Make sure you use the URL given on your Digital Twin Overview screen in front of Hostname as shown above, make sure you start with https://
- Also give appropriate permission to yourself by clicking on the Access Control (IAM) menu
- Select Add role assignment
- Select Azure Digital Twins Data Owner in the Role dropdown listbox
- For the Assign access to setting, select User, group, or service principal
- Now, select the user that you are using in the Azure portal right now and that you’ll use on your local machine to authenticate with the sample application
- Click Save to assign the Role




Quick overview of Azure Data Explorer
A big data analytics platform called Azure Data Explorer makes it simple to quickly evaluate large amounts of data. You may get a complete end-to-end solution for data ingestion, query, visualization, and administration with the Azure Data Explorer toolset.
Azure Data Explorer makes it simple to extract critical insights, identify patterns and trends, and develop forecasting models by analyzing structured, semi-structured, and unstructured data over time series. Azure Data Explorer is helpful for log analytics, time series analytics, IoT, and general-purpose exploratory analytics. It is completely managed, scalable, secure, resilient, and enterprise ready.
Terabytes of data may be ingested by Azure Data Explorer in minutes in batch or streaming mode, and petabytes of data can be searched with millisecond response times. Data can be ingested in a variety of structures and formats. It may enter from a number of channels and sources.
The Kusto Query Language (KQL), an open-source language created by the team, is used by Azure Data Explorer. The language is straightforward to comprehend and learn, and it is quite effective. Both basic operators and sophisticated analyses are available. Microsoft makes extensive use of it (Azure Monitor – Log Analytics and Application Insights, Microsoft Sentinel, and Microsoft 365 Defender). KQL is designed with quick, varied big data exploration in mind. queries any other tabular expressions, including views, functions, and tables. This can involve clusters or even tables from various databases.
Each table’s data is kept as data shards, commonly referred to as “extents.” Based on the ingestion time, all data is automatically indexed and partitioned. There are no main foreign key requirements or other restrictions, like as uniqueness, unlike a relational database. As a result, you may store a wide variety of data and quickly query it thanks to the way it is kept.
Azure Data Explorer
ADX Dashboards is a newly released feature from Microsoft which provide the ability to create various types of data visualizations in one place and in an easy-to-digest form. Dashboards can be shared broadly and allow multiple stakeholders to view dynamic, real time, fresh data while easily interacting with it to gain desired insights. With ADX Dashboards, you can build a dashboard, share it with others, and empower them to continue their data exploration journey. You can say, this is a cheap alternative to PowerBI.
- Create Azure data explorer cluster


*Create a new resource group if required.



2. Add Help database to Visualization Dashboard




StormEvents
| sort by StartTime desc
| take 10

StormEvents
| sort by StartTime desc
| project StartTime, EndTime, State, EventType, DamageProperty, EpisodeNarrative
| take 10

StormEvents
| summarize event_count=count(), mid = avg(BeginLat) by State
| sort by mid
| where event_count > 1800
| project State, event_count
| render columnchart
3. Finally we are ready to create Visualization Dashboard








StormEvents
| summarize event_count=count(), mid = avg(BeginLat) by State
| sort by mid
| where event_count > 1800
| project State, event_count
| render columnchart





Onboard External GCCHigh or commercial User to commercial AD tenant
- Add users as External User in Azure AD. If You are adding a GCC or GCChigh user, you need to follow step 11 before you start step 1.














11. For GCCHigh, below tenant level setting is additionally needed before you follow step 1


- Once added, click on ‘Inherited from default’

- Select ‘Customize Settings’ for B2B collaboration > ‘Allow access’ under external users and group. Set ‘Allow access’ under Applications

- Select ‘Customize Settings’ for B2B Direct Connect > ‘Allow access’ under external users and group. Set ‘Allow access’ under Applications

- Under Microsoft cloud settings select ‘Microsoft Azure Government’

- Now from GCCHigh, go to Access Poratl.azure.com, search Azure Active Directory > ‘External Identities’ from left navigation > Add the GCCHigh tenant ID and then select Add at bottom.


- For GCCHigh we should leave ‘Inherited from default’

- Under Microsoft cloud settings select ‘Microsoft Azure Commercial’

Using Office 365 to meet compliance requirements (e.g. GDPR, HIPAA)
“Stay Compliant with Office 365: Securely Manage Your Data and Meet Your Requirements.”
Introduction
Office 365 is a powerful cloud-based platform that can help organizations meet their compliance requirements. It provides a comprehensive set of tools and services that can help organizations comply with regulations such as the General Data Protection Regulation (GDPR) and the Health Insurance Portability and Accountability Act (HIPAA). Office 365 provides a secure environment for storing and managing data, as well as tools for monitoring and auditing user activity. It also offers features such as encryption, data loss prevention, and multi-factor authentication to help organizations protect their data and meet their compliance requirements. In this article, we will discuss how Office 365 can help organizations meet their compliance requirements.
How Office 365 Can Help You Manage and Monitor Compliance Requirements
Office 365 is a powerful suite of cloud-based tools that can help organizations manage and monitor compliance requirements. With Office 365, organizations can easily create, store, and share documents, emails, and other data in a secure, compliant environment.
Office 365 provides a comprehensive set of compliance tools that can help organizations meet their regulatory requirements. For example, Office 365 includes features such as data loss prevention (DLP) and encryption, which can help organizations protect sensitive data and ensure compliance with data privacy regulations. Additionally, Office 365 provides advanced auditing and reporting capabilities, which can help organizations track user activity and monitor compliance with internal policies.
Office 365 also provides a range of tools that can help organizations manage their compliance requirements. For example, Office 365 includes a Compliance Manager that can help organizations assess their compliance posture and identify areas of risk. Additionally, Office 365 includes a Compliance Scorecard that can help organizations track their compliance progress over time.
Finally, Office 365 provides a range of tools that can help organizations respond quickly to compliance issues. For example, Office 365 includes a Compliance Center that can help organizations quickly identify and address compliance issues. Additionally, Office 365 includes a Compliance Dashboard that can help organizations monitor their compliance posture in real-time.
Overall, Office 365 is a powerful suite of tools that can help organizations manage and monitor their compliance requirements. With Office 365, organizations can easily create, store, and share documents, emails, and other data in a secure, compliant environment. Additionally, Office 365 provides a range of tools that can help organizations assess their compliance posture, track their compliance progress, and respond quickly to compliance issues.
Best Practices for Using Office 365 to Ensure Compliance with Data Protection Regulations
1. Establish a Data Governance Plan: Establishing a data governance plan is essential for ensuring compliance with data protection regulations. This plan should include policies and procedures for data classification, access control, data retention, and data security.
2. Implement Multi-Factor Authentication: Multi-factor authentication (MFA) is a security measure that requires users to provide two or more pieces of evidence to verify their identity. This helps to protect against unauthorized access to Office 365 data.
3. Monitor User Activity: Monitoring user activity is important for ensuring compliance with data protection regulations. Office 365 provides tools for monitoring user activity, such as the Office 365 Security & Compliance Center.
4. Encrypt Data: Encrypting data is an important security measure for protecting sensitive data. Office 365 provides tools for encrypting data, such as Azure Information Protection.
5. Use Data Loss Prevention (DLP): Data loss prevention (DLP) is a security measure that helps to prevent the accidental or intentional loss of sensitive data. Office 365 provides tools for implementing DLP, such as the Office 365 Security & Compliance Center.
6. Implement Access Controls: Access controls are an important security measure for ensuring that only authorized users can access sensitive data. Office 365 provides tools for implementing access controls, such as Azure Active Directory.
7. Monitor Third-Party Access: Monitoring third-party access is important for ensuring compliance with data protection regulations. Office 365 provides tools for monitoring third-party access, such as the Office 365 Security & Compliance Center.
8. Train Employees: Training employees on data protection regulations and best practices is essential for ensuring compliance. Office 365 provides tools for training employees, such as Microsoft Teams.
9. Regularly Audit Data: Regularly auditing data is important for ensuring compliance with data protection regulations. Office 365 provides tools for auditing data, such as the Office 365 Security & Compliance Center.
Understanding the Security Features of Office 365 to Meet Compliance Requirements
Office 365 is a cloud-based suite of productivity tools that provides organizations with a secure and reliable platform for collaboration and communication. As organizations increasingly move their data and applications to the cloud, it is important to understand the security features of Office 365 to ensure compliance with applicable regulations.
Office 365 provides a comprehensive set of security features to help organizations meet their compliance requirements. These features include data loss prevention (DLP), multi-factor authentication (MFA), encryption, and identity and access management (IAM).
Data Loss Prevention (DLP) is a feature that helps organizations protect sensitive data from unauthorized access or accidental disclosure. DLP can be used to detect and block the transmission of sensitive data, such as credit card numbers or Social Security numbers, via email or other communication channels.
Multi-Factor Authentication (MFA) is a security feature that requires users to provide two or more pieces of evidence to verify their identity. This helps to ensure that only authorized users can access sensitive data and applications.
Encryption is a security feature that helps protect data from unauthorized access by scrambling it so that it can only be read by authorized users. Office 365 provides encryption for data at rest, in transit, and in use.
Identity and Access Management (IAM) is a feature that helps organizations manage user access to data and applications. IAM can be used to control who has access to what data and applications, as well as to monitor user activity.
By understanding the security features of Office 365, organizations can ensure that their data and applications are secure and compliant with applicable regulations. These features help organizations protect their data from unauthorized access and ensure that only authorized users can access sensitive data and applications.
How Office 365 Can Help You Meet HIPAA Compliance Requirements
Office 365 is a cloud-based suite of services that can help organizations meet the requirements of the Health Insurance Portability and Accountability Act (HIPAA). HIPAA is a federal law that sets standards for the protection of sensitive patient health information. It requires organizations to implement safeguards to protect the privacy and security of this information.
Office 365 provides a number of features that can help organizations meet HIPAA compliance requirements. These include:
1. Encryption: Office 365 provides encryption for data at rest and in transit. This ensures that data is protected from unauthorized access.
2. Access Control: Office 365 provides access control features that allow organizations to control who has access to sensitive data. This helps ensure that only authorized personnel can access the data.
3. Auditing and Reporting: Office 365 provides auditing and reporting features that allow organizations to track user activity and monitor for potential security issues.
4. Data Loss Prevention: Office 365 provides data loss prevention features that help organizations prevent the accidental or intentional loss of sensitive data.
5. Multi-Factor Authentication: Office 365 provides multi-factor authentication, which requires users to provide additional authentication factors such as a code sent to their mobile device or a biometric scan. This helps ensure that only authorized users can access the data.
By utilizing the features of Office 365, organizations can help ensure that they are meeting the requirements of HIPAA and protecting the privacy and security of sensitive patient health information.
How Office 365 Can Help You Meet GDPR Compliance Requirements
The General Data Protection Regulation (GDPR) is a set of regulations that was created to protect the personal data of European Union (EU) citizens. As a business, it is important to ensure that you are compliant with GDPR regulations. Office 365 can help you meet GDPR compliance requirements by providing a secure platform for storing and managing data.
Office 365 provides a secure environment for storing and managing data. All data stored in Office 365 is encrypted and protected with multi-factor authentication. This ensures that only authorized users can access the data. Additionally, Office 365 provides a comprehensive set of tools for managing data. These tools allow you to control who has access to the data, as well as set up policies for how the data is used and shared.
Office 365 also provides a number of features that can help you meet GDPR compliance requirements. For example, Office 365 provides a Data Loss Prevention (DLP) feature that can help you detect and prevent the unauthorized sharing of sensitive data. Additionally, Office 365 provides a Rights Management Service (RMS) that allows you to control who can access and use the data.
Finally, Office 365 provides a number of tools for monitoring and auditing data usage. These tools allow you to track who is accessing the data and how it is being used. This can help you ensure that the data is being used in accordance with GDPR regulations.
Overall, Office 365 provides a secure platform for storing and managing data that can help you meet GDPR compliance requirements. With its comprehensive set of tools for managing data, Office 365 can help you ensure that your data is secure and that it is being used in accordance with GDPR regulations.
Conclusion
Office 365 is an excellent tool for meeting compliance requirements such as GDPR and HIPAA. It provides a secure platform for storing and sharing data, as well as a range of features that help organizations meet their compliance obligations. With Office 365, organizations can ensure that their data is secure and compliant with the latest regulations. This makes it an ideal choice for organizations looking to meet their compliance requirements.