April 17, 2019

[Updated] How to set new admin user post DB refresh

[Last updated on Feb 24, 2022]

Hi Folks,

Many times we need to get actual data for our development and to get such data in your dev box you need to restore data from either UAT/QA/SIT or any environment which has such data.
Once you complete DB restore in your target system, here issues come, you don't have admin access or maybe SysUser access to this new DB.
Microsoft provides a script to update your email id as admin in your dev box. Follow the below steps to achieve this.

Step 1: Go to your DEV box RDP.

Step 2: Go to below path K:\AosService\PackagesLocalDirectory\Bin (In most cases it will be the same as mentioned if you didn’t find search for ‘PackagesLocalDirectory’ or ‘Packages’ shortcut in one of the drives.

Step 3: Open ‘AdminUserProvisioning’
















Step 4: Enter your email Id, which you want to give admin access to this environment, and click on the submit button.

















Step 5: Here you go.

















the other option is using scripts,

Step1: Run below script on old DataBase


select SID, NETWORKDOMAIN, NETWORKALIAS, * from UserInfo where Id = ‘Admin’

 make a note of all these values.

Step 2: Run below script on new Database

update userinfo
set
networkdomain = ‘YourDomainName’,
networkalias = ‘Administrator’,
SID = ‘SID’

where ID = ‘Admin’




For more details pl check this link


Cheers

Harry
Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

No comments:

Post a Comment

Thanks