Wednesday, 26 February 2014

Determine user membership in active directory domain groups

C:>NET USER  /DOMAIN <username>
The request will be processed at a domain controller for domain <domain name>.

User name                    <username>
Full Name                    <FillName>
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            09/02/2014 12:01:44 PM
Password expires             Never
Password changeable          09/02/2014 12:01:44 PM
Password required            Yes
User may change password     No

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   Never

Logon hours allowed          All

Local Group Memberships
Global Group memberships     *Domain Users         *Domain_2
The command completed successfully.

Wednesday, 19 February 2014

The database principal owns a database role and cannot be dropped.

SQL Command:
DROP USER [User_NAME]

Error Message:
The database principal owns a database role and cannot be dropped.

Solution:
SELECT T2.Name, T1.Name
FROM sys.database_principals AS T1 JOIN sys.database_principals AS T2 ON T1.owning_principal_id = T2.principal_id
 WHERE T1.type = 'R' AND T2.name = 'USER_NAME'

Output:
Database roles from which to remove this user before re-trying the deletion.

Sunday, 16 February 2014

Replace your iTunes media Library by an existing media library

1) Change iTunes library:
Hold down Shift while clicking on the iTunes shortcut.



Choose Libarary... to point to your original library

2) Import existing library folders:
File menu is not enabled by default, to enable it press Alt + F

File --> Add Folder to Library... (Select your original library folder)



-- iTunes 11.1.4.62 (Windows)

Monday, 10 February 2014

SharePoint: Calculating duration in days

Create a new calculated column with the formula:

=IF(OR(ISBLANK([Start Date]), ISBLANK([End Date])),"",DATEDIF([Start Date],[End Date],"d"))

The outcome will be the number of days difference for [End Date] -[Start Date]

Thursday, 6 February 2014

Warning: Unable to update auto-refresh reference...

e.g.Unable to update auto-refresh reference 'ajaxcontroltoolkit.dll'.

I deleted the .refresh file for the problematic dlls; that solved it!