Cleaning temporary database removes my permissions

I'm trying to test the Invoke-DatabaseBuild cmdlet.

I have tried using Windows auth and sql auth.  In both cases, I add my user to the db_owner role for the temporary database.

Then I run the cmdlet

The output is:
Cleaning database 'test_build' on server 'MyServer\MyInstance'.
WARNING: The error 'The server principal "MyDomain\MyUser" is not able to access the database "test_build" under the current security context.' occurred when executing the following SQL:
@ERROR <> 0 SET NOEXEC ON

When i check the temporary database, I can see my user has now been removed from the database and therefore can't proceed with the build.  How do prevent the clean database module from removing my user? 




Tagged:

Best Answer

Sign In or Register to comment.