### Install Scanner with Default Instance Source: https://learn.microsoft.com/en-us/purview/deploy-scanner-configure-install Example of installing the scanner with a default SQL Server instance. ```PowerShell Install-Scanner -SqlServerInstance SQLSERVER1 -Cluster Europe ``` -------------------------------- ### Install Scanner with Named Instance Source: https://learn.microsoft.com/en-us/purview/deploy-scanner-configure-install Example of installing the scanner with a named SQL Server instance. ```PowerShell Install-Scanner -SqlServerInstance SQLSERVER1\SCANNER -Cluster Europe ``` -------------------------------- ### Example Installation of Scanner Source: https://learn.microsoft.com/en-us/purview/upgrade-scanner-migrate An example of how to use the Install-Scanner command, specifying a named SQL Server instance and a cluster name for the upgrade from version 2.x. ```PowerShell Install-Scanner -SqlServerInstance SQLSERVER1\SCANNER -Cluster EU ``` -------------------------------- ### Install Scanner with SQL Server Express Source: https://learn.microsoft.com/en-us/purview/deploy-scanner-configure-install Example of installing the scanner with a SQL Server Express instance. ```PowerShell Install-Scanner -SqlServerInstance SQLSERVER1\SQLEXPRESS -Cluster Europe ``` -------------------------------- ### View .exe Installer Help Source: https://learn.microsoft.com/en-us/purview/information-protection-client Run the .exe installer with the /help parameter to view all available installation options. ```bash PurviewInfoProtection.exe /help ``` -------------------------------- ### Example Employee ID Pattern Source: https://learn.microsoft.com/en-us/purview/data-map-classification-custom This regular expression defines a pattern for employee IDs, starting with 'Employee' followed by a GUID. It's used to identify specific data formats within your data estate. ```regex ^Employee\[A-Za-z0-9\]{8}-\[A-Za-z0-9\]{4}-\[A-Za-z0-9\]{4}-\[A-Za-z0-9\]{4}-\[A-Za-z0-9\]{12}$ ``` -------------------------------- ### GET Lineage by GUID Source: https://learn.microsoft.com/en-us/purview/data-gov-api-create-lineage-relationships Use this GET request to retrieve the lineage of a specific data asset identified by its GUID. The 'direction' parameter can be set to 'BOTH', 'UPSTREAM', or 'DOWNSTREAM' to control the lineage scope. The 'guid_of_table2' should be replaced with the actual GUID of the asset you are querying. ```HTTP GET {{endpoint}}/api/atlas/v2/lineage/{{guid_of_table2}}?direction=BOTH ``` -------------------------------- ### Example: First-time PST import preparation Source: https://learn.microsoft.com/en-us/purview/pst-import-drive-shipping This example demonstrates how to use the WAImportExport.exe tool for the first time to prepare PST files for import. It includes specific values for the journal file, drive, session, source, destination, and log directory. ```command-line WAImportExport.exe PrepImport /j:PSTHDD1.jrn /t:f /id:driveship1 /srcdir:"\FILESERVER1\PSTs" /dstdir:"ingestiondata/" /blobtype:BlockBlob /encrypt /logdir:"c:\users\admin\desktop\PstImportLogs" ``` -------------------------------- ### Example Set-Authentication with OnBehalfOf Source: https://learn.microsoft.com/en-us/purview/deploy-scanner-configure-install This example demonstrates how to use the Set-Authentication command with the -OnBehalfOf parameter, which is useful when the scanner service account lacks 'Log on locally' rights. It includes acquiring credentials and specifying the delegated user and tenant ID. ```PowerShell $pscreds = Get-Credential CONTOSO\scanner Set-Authentication -AppId "00001111-aaaa-2222-bbbb-3333cccc4444" -AppSecret "Aa1Bb~2Cc3.-Dd4Ee5Ff6Gg7Hh8Ii9_Jj0Kk1Ll2" -DelegatedUser scanner@contoso.com -TenantId "aaaabbbb-0000-cccc-1111-dddd2222eeee" -OnBehalfOf $pscreds Acquired application access token on behalf of CONTOSO\scanner. ``` -------------------------------- ### Get Relationship by GUID Source: https://learn.microsoft.com/en-us/purview/data-gov-api-graphql Retrieve detailed information about a specific relationship using its unique GUID. ```graphql query { relationships(where: { guid: "" }) { guid typeName attributes end1 { guid typeName qualifiedName attributes } end2 { guid typeName qualifiedName attributes } } } ``` -------------------------------- ### Create Customer Key Onboarding Request Source: https://learn.microsoft.com/en-us/purview/customer-key-set-up Use this cmdlet to initiate a Customer Key onboarding request. Store the output in a variable for later use. Ensure all parameters are correctly populated before execution. ```PowerShell $request = New-CustomerKeyOnboardingRequest -Organization -Scenario -Subscription1 -KeyIdentifier1 -Subscription2 -KeyIdentifier2 -OnboardingMode ``` -------------------------------- ### Get Sensitivity Labels and GUIDs Source: https://learn.microsoft.com/en-us/purview/sensitivity-labels-teams-groups-sites Retrieve a list of all sensitivity labels and their corresponding GUIDs. This is useful for scripting label application. ```PowerShell Get-Label |ft Name, Guid ``` -------------------------------- ### Run Onboarding Script Source: https://learn.microsoft.com/en-us/purview/device-onboarding-script Execute the onboarding script from an elevated command prompt. Ensure the script path is correct for your device. ```batch %userprofile%\Desktop\DeviceComplianceLocalOnboardingScript.cmd ``` -------------------------------- ### Get Retention Policy Name by GUID Source: https://learn.microsoft.com/en-us/purview/change-the-hold-duration-for-an-inactive-mailbox Use this command to retrieve the name of a retention policy by its GUID, which is extracted from the 'InPlaceHolds' property of an inactive mailbox. Ensure the GUID is stripped of its prefix and suffix. ```powershell Get-RetentionCompliancePolicy cdbbb86ce60342489bff371876e7f224 | FL Name ``` -------------------------------- ### Install Customer Key Onboarding Module Source: https://learn.microsoft.com/en-us/purview/customer-key-set-up Installs the necessary PowerShell module for onboarding Customer Key. This is a prerequisite for creating onboarding requests. ```PowerShell Install-Module -Name M365CustomerKeyOnboarding ``` -------------------------------- ### Get Site ID Example Source: https://learn.microsoft.com/en-us/purview/dlp-test-dlp-policies This example shows how to retrieve a site ID, which is required for the Test-DlpPolicies cmdlet when testing items in SharePoint or OneDrive. ```PowerShell 36ca70ab-6f38-7f3c-515f-a71e59ca6276 ``` -------------------------------- ### Example KeyQL Queries for Query Report Source: https://learn.microsoft.com/en-us/purview/edisc-review-set-query-report These examples demonstrate how to format different types of search queries for the Query Report, including single keywords, multiple keywords with AND logic, and complex KeyQL statements. Ensure each query is on a new line. ```text confidential ``` ```text confidential AND Project Infinity ``` ```text (((FileClass="Email") AND (InclusiveType="InclusiveMinus" OR InclusiveType="Inclusive")) OR ((FileClass="Attachment") AND (UniqueInEmailSet="true")) OR ((FileClass="Document") AND (MarkAsRepresentative="Unique")) OR (FileClass="Conversations")) ``` -------------------------------- ### Get Sensitivity Label GUIDs Source: https://learn.microsoft.com/en-us/purview/apply-retention-labels-automatically Use the Get-Label cmdlet in Security & Compliance PowerShell to retrieve the DisplayName, Name, and Guid for sensitivity labels. ```PowerShell Get-Label | Format-Table -Property DisplayName, Name, Guid ``` -------------------------------- ### Example: Subsequent PST import preparation Source: https://learn.microsoft.com/en-us/purview/pst-import-drive-shipping This example shows how to prepare a second batch of PST files for import using WAImportExport.exe. It uses a new session ID and specifies the source directory for the additional PST files. ```command-line WAImportExport.exe PrepImport /j:PSTHDD1.jrn /id:driveship2 /srcdir:"\FILESERVER1\PSTs\SecondBatch" /dstdir:"ingestiondata/" /blobtype:BlockBlob ``` -------------------------------- ### SHIR Creation Output Example Source: https://learn.microsoft.com/en-us/purview/data-map-integration-runtime-kubernetes This is an example of the expected output when the SHIR is successfully created and provisioned on your Kubernetes cluster. ```Bash [Info] Start to create SHIR with Kubernetes context [your-context]...... [Info] Environment validation passed! [Info] Registering SHIR[example-k8s-shir] for Microsoft Purview Account [yourpurviewaccount]...... [Info] SHIR Registration done! [Info] Provisioning SHIR, it may take about 5-30 minutes......done! [Info] SHIR creation succeeded! ``` -------------------------------- ### Create and Start a Compliance Search Source: https://learn.microsoft.com/en-us/purview/edisc-search-mailbox-data This example demonstrates how to create a new compliance search for all mailboxes and then start the search using the New-ComplianceSearch and Start-ComplianceSearch cmdlets. ```PowerShell $Search=New-ComplianceSearch -Name "Remove Phishing Message" -ExchangeLocation All -ContentMatchQuery '(Received:4/13/2016..4/14/2016) AND (Subject:"Action required")' Start-ComplianceSearch -Identity $Search.Identity ``` -------------------------------- ### Get Relationship Information by GUID Source: https://learn.microsoft.com/en-us/purview/concept-best-practices-migration Retrieve relationship details between entities using their unique GUID. This is the first step in remapping relationships during asset migration. ```json "guid": "c018ddaf-7c21-4b37-a838-dae5f110c3d8" ``` -------------------------------- ### Databricks Mount Point Output Example Source: https://learn.microsoft.com/en-us/purview/register-scan-azure-databricks This is an example of the output from the `dbutils.fs.mounts()` command, showing various mount points and their sources. ```text [MountInfo(mountPoint='/databricks-datasets', source='databricks-datasets', encryptionType=''), MountInfo(mountPoint='/mnt/ADLS2', source='abfss://samplelocation1@azurestorage1.dfs.core.windows.net/', encryptionType=''), MountInfo(mountPoint='/databricks/mlflow-tracking', source='databricks/mlflow-tracking', encryptionType=''), MountInfo(mountPoint='/mnt/Blob', source='wasbs://samplelocation2@azurestorage2.blob.core.windows.net', encryptionType=''), MountInfo(mountPoint='/databricks-results', source='databricks-results', encryptionType=''), MountInfo(mountPoint='/databricks/mlflow-registry', source='databricks/mlflow-registry', encryptionType=''), MountInfo(mountPoint='/', source='DatabricksRoot', encryptionType='')] ``` -------------------------------- ### Get Lineage by GUID Source: https://learn.microsoft.com/en-us/purview/data-gov-api-create-lineage-relationships Retrieves the lineage relationships for a given data asset identified by its GUID. It supports specifying the direction of lineage (e.g., BOTH, UPSTREAM, DOWNSTREAM). ```APIDOC ## GET /api/atlas/v2/lineage/{guid} ### Description Retrieves the lineage of a specified data asset. ### Method GET ### Endpoint /api/atlas/v2/lineage/{{guid_of_table2}} ### Parameters #### Path Parameters - **guid_of_table2** (string) - Required - The unique identifier (GUID) of the data asset for which to retrieve lineage. #### Query Parameters - **direction** (string) - Optional - Specifies the direction of lineage to retrieve. Accepted values are 'BOTH', 'UPSTREAM', 'DOWNSTREAM'. Defaults to 'BOTH'. ### Response #### Success Response (200) - **baseEntityGuid** (string) - The GUID of the base entity for which lineage was queried. - **lineageDirection** (string) - The direction of lineage returned. - **lineageDepth** (integer) - The depth of the lineage search. - **lineageWidth** (integer) - The width of the lineage search. - **childrenCount** (integer) - The number of children entities in the lineage. - **guidEntityMap** (object) - A map where keys are entity GUIDs and values are entity objects. - **includeParent** (boolean) - Indicates if parent entities are included. - **relations** (array) - An array of lineage relationship objects. - **parentRelations** (array) - An array of parent relationship objects. - **widthCounts** (object) - Counts of entities at different widths of the lineage. ### Response Example ```json { "baseEntityGuid": "2a12b3ff-5816-4222-833a-035bf82e06e0", "lineageDirection": "BOTH", "lineageDepth": 3, "lineageWidth": -1, "childrenCount": -1, "guidEntityMap": { "16b93b78-8683-4f88-9651-24c4a9d797b0": { "typeName": "hive_table", "attributes": { "temporary": false, "lastAccessTime": 0, "createTime": 0, "qualifiedName": "test_lineage.table3", "name": "table3", "retention": 0 }, "lastModifiedTS": "1", "guid": "16b93b78-8683-4f88-9651-24c4a9d797b0", "status": "ACTIVE", "displayText": "table3", "classificationNames": [], "meaningNames": [], "meanings": [], "isIncomplete": false, "labels": [], "isIndexed": true }, "cb22ba23-47a2-4149-ade6-e3d9642fe592": { "typeName": "hive_table", "attributes": { "temporary": false, "lastAccessTime": 0, "createTime": 0, "qualifiedName": "test_lineage.table1", "name": "table1", "retention": 0 }, "lastModifiedTS": "1", "guid": "cb22ba23-47a2-4149-ade6-e3d9642fe592", "status": "ACTIVE", "displayText": "table1", "classificationNames": [], "meaningNames": [], "meanings": [], "isIncomplete": false, "labels": [], "isIndexed": true }, "bbeacce6-5bde-46f7-8fe4-689cbb36ba51": { "typeName": "hive_view_query", "attributes": { "qualifiedName": "test_lineage.HiveQuery1", "name": "HiveQuery1", "columnMapping": "[{\"DatasetMapping\":{\"Source\":\"test_lineage.table1\",\"Sink\":\"test_lineage.table2\"},\"ColumnMapping\":[{\"Source\":\"column1\",\"Sink\":\"column1\"},{\"Source\":\"column2\",\"Sink\":\"column2\"}]}]" }, "lastModifiedTS": "1", "guid": "bbeacce6-5bde-46f7-8fe4-689cbb36ba51", "status": "ACTIVE", "displayText": "HiveQuery1", "classificationNames": [], "meaningNames": [], "meanings": [], "isIncomplete": false, "labels": [], "isIndexed": true }, "2a12b3ff-5816-4222-833a-035bf82e06e0": { "typeName": "hive_table", "attributes": { "temporary": false, "lastAccessTime": 0, "createTime": 0, "qualifiedName": "test_lineage.table2", "name": "table2", "retention": 0 }, "lastModifiedTS": "1", "guid": "2a12b3ff-5816-4222-833a-035bf82e06e0", "status": "ACTIVE", "displayText": "table2", "classificationNames": [], "meaningNames": [], "meanings": [], "isIncomplete": false, "labels": [], "isIndexed": true } }, "includeParent": false, "relations": [ { "fromEntityId": "2a12b3ff-5816-4222-833a-035bf82e06e0", "toEntityId": "16b93b78-8683-4f88-9651-24c4a9d797b0", "relationshipId": "23df8e3e-b066-40b2-be29-9fd90693c51b", "columnMapping": "[{\"Source\":\"column1\",\"Sink\":\"column1\"},{\"Source\":\"column2\",\"Sink\":\"column2\"}]" }, { "fromEntityId": "bbeacce6-5bde-46f7-8fe4-689cbb36ba51", "toEntityId": "2a12b3ff-5816-4222-833a-035bf82e06e0", "relationshipId": "5fe8d378-39cd-4c6b-8ced-91b0152d3014" }, { "fromEntityId": "cb22ba23-47a2-4149-ade6-e3d9642fe592", "toEntityId": "bbeacce6-5bde-46f7-8fe4-689cbb36ba51", "relationshipId": "73e084bf-98a3-45fb-a1e4-c56cc40661b8" } ], "parentRelations": [], "widthCounts": { "INPUT": { "cb22ba23-47a2-4149-ade6-e3d9642fe592": 0, "bbeacce6-5bde-46f7-8fe4-689cbb36ba51": 1, "2a12b3ff-5816-4222-833a-035bf82e06e0": 1 }, "OUTPUT": { "16b93b78-8683-4f88-9651-24c4a9d797b0": 0, "2a12b3ff-5816-4222-833a-035bf82e06e0": 1 } } } ``` ``` -------------------------------- ### Get Retention Policy Name by GUID (Retention Label) Source: https://learn.microsoft.com/en-us/purview/change-the-hold-duration-for-an-inactive-mailbox Similar to retention policies, this command retrieves the name of the publishing policy for a retention label using its GUID. The GUID should be extracted from the 'InPlaceHolds' property and stripped of its prefix and suffix. ```powershell Get-RetentionCompliancePolicy 6fe063689d404a5bb9940eed0f0bf5d2 | FL Name ``` -------------------------------- ### Site and SiteContent filter examples for Path Source: https://learn.microsoft.com/en-us/purview/edisc-search-permission-filtering Examples demonstrating interchangeable Site and SiteContent filters to specify search locations based on site path. ```powershell "Site_Path -like 'https://contoso.sharepoint.com/sites/doctors'" ``` ```powershell "SiteContent_Path -like 'https://contoso.sharepoint.com/sites/doctors'" ```