Tuesday, June 10, 2014

Dead in the Water

Definition:  Not moving (used only when a vessel is afloat and neither tied up nor anchored).

Often times, you'll need to restore a production database to a development and test instance so that developers have current data for their testing.  If the database has local database users, these accounts will need to be 'fixed' so they are properly associated with the local SQL logins on this other instance.  Until these accounts are fixed, your developers will be 'Dead in the Water'.


To see the accounts that need to be fixed, execute:

sp_change_users_login 'report'

To fix the accounts, run:
exec sp_change_users_login 'UPDATE_ONE','AccountName','AccountName'


Once these accounts are fixed, your developers can "Shift Colors" and get underway!





Thursday, January 23, 2014

Sweepers, Sweepers, Man Your Brooms



Users will always have some type of home directory where they can store their data.  Often times, these directories are not deleted after a user leaves the company.

Try this short script to see if what directories are not tied to existing accounts in your Active Directory:

 foreach ($user in get-content c:\temp\users.txt)
 {if( Get-QADUser -LogonName $user ) {$user + ",exists"} else {$user +",does not exist in AD"}
         }



"Sweepers, Sweepers, man your brooms. Give the ship a good clean sweep down both fore and aft! Sweep down all lower decks, ladder backs and passageways! Dump all garbage clear of the fantail!"