Monday, August 15, 2016
C# - comparing version numbers
I wasted some time this morning writing my own version comparer, trying to write something short and smart that would be able to compare, if, for example,
version 4.56.7 is greater than version 4.3.2.1
turns out C# already has a lib for that :
https://msdn.microsoft.com/en-us/library/system.version.aspx
It can take up to 4 dot-separated components - major, minor, build, and revision.
version 4.56.7 is greater than version 4.3.2.1
turns out C# already has a lib for that :
https://msdn.microsoft.com/en-us/library/system.version.aspx
It can take up to 4 dot-separated components - major, minor, build, and revision.
Tuesday, August 9, 2016
SSRS Reporting Services - Site Settings security with PowerShell
Handy little PowerShell to automate adding a User or a Group to Site Settings of SSRS 2008 R2:
based on https://social.technet.microsoft.com/Forums/sqlserver/en-US/ea8824fb-e1c4-4266-9e73-ef00a6c0a6cd/site-settings-security-using-rss-scripts?forum=sqlreportingservices
$rs = New-WebServiceProxy -uri "http://server/reportserver/ReportService2010.asmx?WSDL" -UseDefaultCredential -namespace "ReportingService2010" -class Reporting
$existingpolicies = $rs.GetSystemPolicies()
$Policy = New-Object -TypeName "ReportingService2010.Policy"
$Roles = @()
$Role = New-Object -TypeName "ReportingService2010.Role"
$Role.Name = "System User"
$Roles += $Role
$Policy.Roles = $Roles
$Policy.GroupUserName = "DOMAIN\USERORGROUP"
$PolicyAlreadyExists = $false
$existingpolicies | Foreach-Object{
if ($_.GroupUserName -eq "DOMAIN\USERORGROUP")
{$PolicyAlreadyExists = $true} }
$Policies = @($existingpolicies)
$Policies += $Policy
if(-not $PolicyAlreadyExists)
{
$rs.SetSystemPolicies($Policies)
}
based on https://social.technet.microsoft.com/Forums/sqlserver/en-US/ea8824fb-e1c4-4266-9e73-ef00a6c0a6cd/site-settings-security-using-rss-scripts?forum=sqlreportingservices
Wednesday, July 13, 2016
Capturing output from external commands in PowerShell
Great article on running external commands from PowerShell:
http://edgylogic.com/blog/powershell-and-external-commands-done-right/
Especially useful - information on capturing output from external commands in PowerShell:
for example:
http://edgylogic.com/blog/powershell-and-external-commands-done-right/
Especially useful - information on capturing output from external commands in PowerShell:
for example:
& schtasks /END /TN $TaskName | Tee-Object -Variable scriptOutput | Out-Null
Write-Host $scriptOutput
Wednesday, June 29, 2016
Powershell: Copy files from Network location
Monday, April 25, 2016
Toggle Visibility Show As Expanded + – in SSRS
Very helpful post that describes how to set the group to be expanded by default and so that the signs are shown correctly (+ and -)
http://bicg.com.au/toggle-visibility-show-as-expanded-in-ssrs/
http://bicg.com.au/toggle-visibility-show-as-expanded-in-ssrs/
Wednesday, April 13, 2016
Connecting to SQL Server Mobile Report Publisher in SSRS 2016 RC2
I was struggling a bit with connecting to SQL Server Mobile Report Publisher in SSRS 2016 RC2. When I wanted to load data from Data Sets that are created in SSRS, I had to connect to SSRS first. I was presented with a very laconic UI, and I had to struggle with a couple of errors, without seeing any details of what was wrong.
Now, I eventually figured out that Server Address, apparently expects the URL of this type:
http://localhost/reports
and Username and Password are your Domain accounts and "Use secure connection" must be unchecked!
Only then it started working, and I was able to see my DataSets and Data Sources.
Subscribe to:
Posts (Atom)