Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Clone Users from one Workspace to another | |
Start by specifying the Target Workspace | |
Then use the Out-GridView cmdlet to choose the Source Workspce to copy the users & roles from. | |
https://powerbi.microsoft.com/en-us/blog/announcing-apis-and-powershell-cmdlets-for-power-bi-administrators/ #> | |
$TargetWorkspace = Get-PowerBIWorkspace -Name 'New QA Workspace'; | |
(Get-PowerBIWorkspace | | |
Out-GridView -PassThru | | |
foreach { Get-PowerBIWorkspace -Id $_.Id -Scope Organization }).Users | | |
WHERE { $_.AccessRight -ne 'Viewer' } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# We need an argument completer for -Workspace #> | |
Register-ArgumentCompleter -ParameterName Workspace -ScriptBlock { | |
Get-PowerBIWorkspace | ForEach-Object { | |
$CompletionText = $_.Name | |
New-Object System.Management.Automation.CompletionResult ( | |
"(Get-PowerBIWorkspace -Name '$($CompletionText)')", | |
$_.Name, | |
'ParameterValue', | |
"$_ (PowerBIWorkspace)" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90..1 | | |
foreach { | |
$Date = (((Get-Date).Date).AddDays(-$_)) | |
$StartDate = (Get-Date -Date ($Date) -Format yyyy-MM-ddTHH:mm:ss) | |
$EndDate = (Get-Date -Date ((($Date).AddDays(1)).AddMilliseconds(-1)) -Format yyyy-MM-ddTHH:mm:ss) | |
Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndDate -ResultType JsonString | | |
Out-File -FilePath "c:\temp\PowerBIAuditLogs\PowerBI_AudititLog_$(Get-Date -Date $Date -Format yyyyMMdd).json" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir -Filter *.csv | | |
foreach { | |
"$($_.Name)"; | |
,(Import-Csv -Path $_.Name) | | |
Write-SqlTableData -ServerInstance localhost\SQL2017 -DatabaseName BlankDB -SchemaName dbo -TableName $_.BaseName -Force | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UserCredential = Get-Credential 'your.email@somewhere.com' | |
90..1 | | |
foreach { | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
$Start=((Get-Date).Date).AddDays(-$_); | |
Search-UnifiedAuditLog -StartDate $Start -EndDate $Start.AddDays(1) -RecordType PowerBI -ResultSize 5000 | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.