Remove item from Programs and Features list in Windows 7

If the uninstallation of an program fails, the item will not be removed from the “Programs and Features” list on the Control Panel in Windows 7. To remove the item, remove the item from the registry key: Windows 7 x64 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall   Windows 7 x86 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall   Note Removing the …

How to deploy a report (*.rdl) file to SQL Server Reporting Services using PowerShell

If you want to deploy a report (*.rdl) file to SQL Server Reporting Services in PowerShell, use the following script:   PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") "Create report" $report = New-Object Ada.Cdf.Deployment.SSRS.Report $report.SSRSWebServiceUrl = "http://localhost/ReportServer/ReportService2005.asmx" $report.SSRSFolder = "ADA Sales Reports" $report.FileSystemPath = "C:\Reports\AanvragenStats.rdl" …

How to deploy a datasource in SQL Server Reporting Services with PowerShell

If you want to use PowerShell to deploy a datasource in SQL Server Reporting Services use the following script:   PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") $datasource = New-Object Ada.Cdf.Deployment.SSRS.DataSource $datasource.SSRSWebServiceUrl = "http://localhost/ReportServer/ReportService2005.asmx" $datasource.ImpersonateUser = $false $datasource.WindowsIntegratedSecurity = $true $datasource.UserAccountName = "MyDomain\saAsaWeb" $datasource.UserAccountPassword = …

How to create a folder in SQL Server Reporting Services with PowerShell

If you want to use PowerShell to create a folder in SQL Server Reporting Services use the following script: PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") $folder = New-Object Ada.Cdf.Deployment.SSRS.Folder $folder.SSRSWebServiceUrl = "http://localhost/ReportServer/ReportService2005.asmx" $folder.Name = "ADA Sales Reports" $folder.Parent = "/" $folder.Create()       …

Explaining SSRS datasource options “Use as Windows credentials when connecting to the datasource” and “Impersonate the authenticated user after a connection has been made to the datasource”

In SSRS ther are two options you can set, when the credentials of the datasource are stored securely in the report server: Use as Windows crendentials when connecting to the datasource This option must be checked, when you want to use “Windows Integrated Security Authentication” and not “SQL Authentication” Impersonate …

How to make sure the first character of a string is one slash ‘/’ with C#, use the TrimStart function

If you want to make sure the first character of a string is one slash, use the function: public string PrependPath(string path, string firstCharacter) { return firstCharacter + path.TrimStart(firstCharacter.ToCharArray()); }   To test the function use: string firstCharacter = "/"; Console.WriteLine(PrependPath("TestPath", firstCharacter)); Console.WriteLine(PrependPath("/TestPath", firstCharacter)); Console.WriteLine(PrependPath("//TestPath", firstCharacter)); Console.WriteLine(PrependPath("///TestPath", firstCharacter));   Result …

# How to list members of the local computer group [IIS_IUSRS] with PowerShell

If you want to list all members of the local computer group IIS_IUSRS with PowerShell, use this script:   [Script] "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted $iisIUSRS = [ADSI]"WinNT://L014/IIS_IUSRS,group" "Loop members" foreach ($member in $iisIUSRS.Invoke("Members", $null)) {     # Cast object to type DirectoryEntry     $de = New-Object System.DirectoryServices.DirectoryEntry($member) …