Thursday, March 30, 2017

Restore 127.0.0.1 routes Windows

After commad route -f all routes will be removed.

To restore loopback adapter rotes use this commands :

route add  127.0.0.0 mask 255.0.0.0  0.0.0.0 metric 306 if 1
route add  127.0.0.1 mask 255.255.255.255  0.0.0.0 metric 306 if 1
route add  255.255.255.255 mask 255.255.255.255  0.0.0.0 metric 306 if 1

Wednesday, March 29, 2017

Sharepoint popup window on main page

To show popup window on Sharepoint page add script editor :


<script type="text/javascript">
    function codeAddress() {
        alert('Your message text');
        SP.UI.ModalDialog.showModalDialog(options);
    }
    window.onload = codeAddress;
</script> 

Sharepoint Birthday List

Create Collums:

  • Username                           > People or Group
  • Birthday                              >  Date Only format
  • Next Birthday                      > Calculated field        
  • Days until B'day                  > Calculated field


Next Birthday contains following formula:
=DATE(YEAR(Birthday)+DATEDIF(Birthday,TODAY(),"Y"),MONTH(Birthday),DAY(Birthday))

Days until B'day contains following formula:
=IF([Next Birthday]=TODAY(),"Happy Birthday","has birthday in "&DATEDIF(TODAY(),[Next Birthday],"d")&" days")

To show only today birthday modify view and add filter Days until B'day contains Happy.

Tuesday, March 21, 2017

Reset Ad user password in OU

Reset Active Directory multiple users password in OU using powershell:

# Specify the OU.
$OU = [ADSI]"LDAP://ou=West,dc=MyDomain,dc=local"

# Enumerate all objects in the OU.
$arrChildren = $OU.Get_Children()
ForEach ($User In $arrChildren)
{
    # Only consider user objects.
    If ($User.Class -eq "user")
    {
        # Set password.
        $User.Invoke("SetPassword""123-zxc")
        # Expire the password.
        $User.pwdLastSet = 0
        $User.SetInfo()
    }
}

Monday, March 13, 2017

Rename New Discussion Sharepoint

To Rename New Discussion Sharepoint add Script editor :



<script type="text/javascript" src="/SiteAssets/Scripts/jquery-1.9.1.js"></script>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
   jQuery("a:contains('new discussion')").html("text what you want");
 });
</script>


Also you can rename New Picture, new document and ...

Monday, February 27, 2017

View Disk size and free space from CMD

wmic logicaldisk get size,freespace,caption

Saturday, February 25, 2017

Change msRTCSIP-GroupingID for multiple users

If you want In your organization to separate several Organizations from seeing each other.
You must set OU GUID  to msRTCSIP-GroupingID attribute.

After getting the OU ObjectGUID we set this GUID as the msRTCSIP-GroupingID option for all users in that OU.

to do this using powershell for multiple users:

copy OU ObjectGUID.
for example: 2DCF9FC8-CB7C-4382-AA97-EF9B890B9B6A

copy this GUID and convert this GUID to Hexadecimal

use this site:
http://www.windowstricks.in/online-windows-guid-converter

after converting we'll have C89FCF2D7CCB8243AA97EF9B890B9B6A

change this format to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

C89FCF2D-7CCB-8243-AA97-EF9B890B9B6A


first import the AD PowerShell Module:

Import-Module ActiveDirectory

$Users = Get-Content c:\tmp\atribute.txt

ForEach ($User in $Users) {

Set-ADUser -Server test.local -Identity "$user" -replace @{'msRTCSIP-GroupingID'=[GUID]("C89FCF2D-7CCB-8243-AA97-EF9B890B9B6A")}
}