Wednesday, January 13, 2016

Sharepoint 2013 find SQL servers name

Open regedit :

\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDb

Dsn key: Data Source= "server FQDN"

Find Users not signed Mail 30 days

get-mailbox  -resultsize unlimited | Get-MailboxStatistics |?{$_.LastLogonTime -lt (date)
.adddays(-30)} | ft DisplayName,ItemCount,LastLogonTimeLast,LogoffTime,LastLoggedOnUserAccount -auto

Windows Networking CMDs

1. To see your routing table, run either of these commands:
    
    route print

or

    netstat -r

2. To add an entry to your routing table that will be permanent, run the route add command with the –p option. Omitting that, the entry will be lost at next reboot:
    
route add 0.0.0.0 mask 0.0.0.0 172.16.250.5 –p


3. To see all open network connections

    netstat –an

How to find out all locked out accounts in AD using Powershell


Search-ADAccount -LockedOut
The output from this cmdlet will list all the locked out accounts.  

If you want to unlock all those accounts:
Search-ADAccount -LockedOut | Unlock-ADAccount

Temporary User Profile


   Log in with temp profile.
b)      Start registry editor by typing regedit in find box of Windows 7.
c)      Navigate the following location.
d)      You will see similar keys under profile list, but one with .bak, as shown below.

e)      The key with .bak is for the correct old profile. Currently your Windows 7 computer logged in with fresh (temporary) profile with same key. So, rename the new profile key ( which is not having.bak) and remove .bak from correct profile key. See below.

f)      That’s it. Log off and log in (or restart) with your user name and password. You must get your correct profile with icons and profile settings back in Windows 7, if you are lucky enough

Change default printer for all users on this computer

ntprint /setdefault name=<printer name> 

Add Static Route Windows

ROUTE ADD -P <target PC's IP> MASK <Subnet mask from ipconfig> <Default Gateway of the adapter in the domain> if <tried it with all possible interfaces>


route ADD -P 10.10.10.0 MASK 255.255.255.0 192.168.1.12