Skip to main content

Automating adding user to user groups

Every now and then, I would come across situation, where I have to add new member to project. As part of the process, I have to give the new guys user permission to the machine (mostly BizTalk Server machines). When you have multiple servers, the task gets monotonous. During once such, instance, I sought the enlightenment google caters and found below script to do the same, in matter of seconds. I am not sure which article guided me to the solution, so I am not referencing it.

Below is the script for adding users to group, generally for stand alone BizTalk machine,

$group = [ADSI]"WinNT://localhost/Users"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Application Users"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Isolated Host Users"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Server Administrators"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Server Operators"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SQLServerMSASUser`$BTS2016`$MSSQLSERVER"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SSO Administrators"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SSO Affiliate Administrators"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/Administrators"
$group.psbase.Invoke("Add",([ADSI]"WinNT://<domain>/<username>").path)



In order to remove user, use below script,

$group = [ADSI]"WinNT://localhost/Users"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Application Users"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Isolated Host Users"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Server Administrators"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/BizTalk Server Operators"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SQLServerMSASUser`$BTS2016`$MSSQLSERVER"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SSO Administrators"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/SSO Affiliate Administrators"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)

$group = [ADSI]"WinNT://localhost/Administrators"
$group.psbase.Invoke("remove",([ADSI]"WinNT://<domain>/<username>").path)


Powershell has active directory module, which you can use to add/remove user to group, in case BizTalk access is managed through AD.

Comments

Popular posts from this blog

BizTalk 2020 Unboxing - Part 1

Today I got my hands on BizTalk 2020 installable and I deployed it on a SQL Server 2019 Developer  image in Azure. Following is run down of apparent difference you will see when you are going through process of installing and deploying BizTalk 2020.

Installation:
While Installing first thing I noted was that now we have "BizTalk TMS" feature, this was part of feature pack 3, now it is part of main installation.


Every other instillation is same Enterprise Adapter, ESB ToolKit and HL7 Accelerator. I did not check other accelerators.

Configuration:
Along with the usual you will have to configure, BizTalk Rest API and BizTalk TMS, BizTalk Rest API was part of feature pack 1 release of BizTalk 2016, here is link to detail of what it exposes. At the end of this post I have attached screen shot of all the exposed operations.

BizTalk Admin Console
The first thing I check out after installation is new Adapter for us to play with, found new kids on the block, i.e. AzureBlobStorage and E…

BizTalk Deployment Framework fix for compatibility issues with BizTalk 2016

Objective My objective was to modify BizTalk Deployment framework source, with the intend of getting it to work with BizTalk 2016, as it does not work out of the box with BizTalk 2016.
Source Location BizTalk Deployment Framework source is located at CodePlex and downloaded from below link https://biztalkdeployment.codeplex.com/SourceControl/latest It has BTDF 6.0 under dev folder and BTDF 5.0- 5.6 under release folder. BTDF 5.6 release version is more suited, as it is a stable release, hence it is modified to suit our need. All the references going forth are from the 5.6 release folder.
Modifications Below is the modification that were done in order to get BTDF 5.6 release version, working.    1.Added copy of BizTalk 2016 SSOClient to \Tools\SSOSettingsFileImport\ExternalReferences\BTS2016\Microsoft.BizTalk.Interop.SSOClient.dll, we will use as reference later. 2.In solution, \Tools\SSOSettingsFileImport\SSOSettingsFileImport.sln clone projects SSOSettingsEditorBTS2013R2, SSOSettingsFile…