#!/bin/bash# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"query="query { o365Mailboxes(o365OrgId: \\\"0876804E-1CB1-4F28-BCB3-B4390C15FA1F\\\") { nodes { name id effectiveSlaDomain { name id } } } }"# Execute the GraphQL query with curlcurl-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $RSC_TOKEN"\-d"{\"query\": \"$query\"}"\https://example.my.rubrik.com/api/graphql
#!/bin/bash# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"query="query { o365Onedrives(o365OrgId: \\\"0876804E-1CB1-4F28-BCB3-B4390C15FA1F\\\") { nodes { name id effectiveSlaDomain { name id } } } }"# Execute the GraphQL query with curlcurl-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $RSC_TOKEN"\-d"{\"query\": \"$query\"}"\https://example.my.rubrik.com/api/graphql
Searching M365 OneDrives
query{snappableOnedriveSearch(orgId:"0876804E-1CB1-4F28-BCB3-B4390C15FA1F"# example UUIDsnappableFid:"123e4567-e89b-12d3-a456-426614174000"onedriveSearchFilter:{searchKeywordFilter:{keywordType:NAMEsearchKeyword:"example.pdf"# Replace the above with below for searching for file types#keywordType: FILE_TYPE#searchKeyword: "pdf"}searchObjectFilter:{# to search folders use O365_FOLDERsearchObjectType:ONEDRIVE_FILE}}){nodes{nameidsizeparentFolderIdchannelNamecreateTimemodifiedTime...onO365OnedriveFile{fileTypeobjectTypesnapshotIdsnapshotNumsnapshotTime}...onO365OnedriveFolder{objectTypesnapshotIdsnapshotNumsnapshotTime}}}}
$query=New-RscQuery-GqlQuerysnappableOnedriveSearch$query.var.orgId="0876804E-1CB1-4F28-BCB3-B4390C15FA1F"$query.var.snappableFid="123e4567-e89b-12d3-a456-426614174000"$query.var.onedriveSearchFilter=Get-RscType-NameOnedriveSearchFilter$query.var.onedriveSearchFilter.searchKeywordFilter=Get-RscType-NameOnedriveSearchKeywordFilter$query.var.onedriveSearchFilter.searchKeywordFilter.keywordType=[RubrikSecurityCloud.Types.OnedriveSearchKeywordType]::NAME$query.var.onedriveSearchFilter.searchKeywordFilter.searchKeyword="example.pdf"# replace the above two lines with below for searching for file types# $query.var.onedriveSearchFilter.searchKeywordFilter.keywordType = [RubrikSecurityCloud.Types.OnedriveSearchKeywordType]::FILE_TYPE# $query.var.onedriveSearchFilter.searchKeywordFilter.searchKeyword = "pdf"$query.var.onedriveSearchFilter.searchObjectFilter=Get-RscType-NameOnedriveSearchObjectFilter$query.var.onedriveSearchFilter.searchObjectFilter.searchObjectType=[RubrikSecurityCloud.Types.OnedriveSearchObjectType]::ONEDRIVE_FILE# replace the above line with below for searching for folders# $query.var.onedriveSearchFilter.searchObjectFilter.searchObjectType = [RubrikSecurityCloud.Types.OnedriveSearchObjectType]::O365_FOLDER$query.field.nodes=@(Get-RscType-NameO365OnedriveFile-InitialPropertiesname,`id,`size,`parentFolderId,`channelName,`createTime,`modifiedTime,`fileType,`objectType,`snapshotId,`snapshotNum,`snapshotTime)$query.field.nodes+=@(Get-RscType-NameO365OnedriveFolder-InitialPropertiesname,`id,`size,`parentFolderId,`channelName,`createTime,`modifiedTime,`objectType,`snapshotId,`snapshotNum,`snapshotTime)$query.invoke().nodes
#!/bin/bash# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"query="query { snappableOnedriveSearch( orgId: \\\"0876804E-1CB1-4F28-BCB3-B4390C15FA1F\\\" snappableFid: \\\"123e4567-e89b-12d3-a456-426614174000\\\" onedriveSearchFilter: { searchKeywordFilter: { keywordType: NAME searchKeyword: \\\"example.pdf\\\" } searchObjectFilter: { searchObjectType: ONEDRIVE_FILE } } ) { nodes { name id size parentFolderId channelName createTime modifiedTime ... on O365OnedriveFile { fileType objectType snapshotId snapshotNum snapshotTime } ... on O365OnedriveFolder { objectType snapshotId snapshotNum snapshotTime } } } }"# Execute the GraphQL query with curlcurl-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $RSC_TOKEN"\-d"{\"query\": \"$query\"}"\https://example.my.rubrik.com/api/graphql
#!/bin/bash# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"query="query { o365Teams(o365OrgId: \\\"0876804E-1CB1-4F28-BCB3-B4390C15FA1F\\\") { nodes { name id effectiveSlaDomain { name id } } } }"# Execute the GraphQL query with curlcurl-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $RSC_TOKEN"\-d"{\"query\": \"$query\"}"\https://example.my.rubrik.com/api/graphql
#!/bin/bash# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"query="query { o365Sites(o365OrgId: \\\"0876804E-1CB1-4F28-BCB3-B4390C15FA1F\\\") { nodes { name id effectiveSlaDomain { name id } } } }"# Execute the GraphQL query with curlcurl-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $RSC_TOKEN"\-d"{\"query\": \"$query\"}"\https://example.my.rubrik.com/api/graphql