Wednesday, September 13, 2017

Port forwarding on WIndows Server

run cmd as Administrator

netsh interface portproxy add v4tov4 listenaddress=YOUR_IP_HERE listenport=8080 connectaddress=YOUR_IP_HERE connectport=80

to view proxy rules use this command:

netsh interface portproxy show all


tocheck use this command:

netstat -ano | findstr :<listenport number>

To delete this rule use command:

netsh interface portproxy delete v4tov4 listenaddress=YOUR_IP_HERE listenport=8080 connectaddress=YOUR_IP_HERE connectport=80





Wednesday, September 6, 2017

Exchange 2010: can’t remove move request – Failed to communicate with the mailbox database

After a failed move request, the mailbox is still marked is being moved and cannot be removed again

After a failed move request, sometimes (for unknown reason) the mailbox is still marked is being moved and cannot be removed again... the mailbox is shown with a green icon on the EMC (Exchange Management Console), however it cannot be seen on the "Move Request" section or with Get-MoveRequest command and cannot be cleared with the Remove-MoveRequest command.


1. Open User Attributes
2. Scroll down the attributes and search for an entry called "msExchMailboxMoveTargetMDBLink" and "msExchMailboxMoveBatchName".
5. Click on the "Edit" button.
6. Click on the "Clear" button.
7. Click the "OK" button.

If you have many users you can use powershell script:


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

ForEach ($User in $Users) {

Set-ADUser -Server test.local -Identity "$user" -Clear "msExchMailboxMoveTargetMDBLink"
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$Users = Get-Content c:\tmp\atribute.txt

ForEach ($User in $Users) {

Set-ADUser -Server test.local -Identity "$user" -Clear "msExchMailboxMoveBatchName"
}
in c:\tmp\atribute.txt put user DN-s.

After this you can remove failed moves from exchange console.

Friday, September 1, 2017

Troubleshooting KMS Server

run from CMD: nslookup -type=srv _vlmcs._tcp


Check if the server is up and running.
Check if the “Software Protection” service (sppsvc) is running.
Verify if the KMS service is listening on port 1688: telnet localhost 1688
Verify the KMS status. Run from CMD: slmgr.vbs /dli
Verify if a KMS key is installed and activated.
Verify if the minimum threshold for activation is being met.
Verify if other clients are able to activate using KMS. Even though the output of “slmgr.vbs /dli” gives you an indication, you can use the “Volume Activation Management Tool” (VAMT) for more insight and functionality.
Verify that a VLK key is being used.

Set the MaxPageSize in Active Directory

In large environments there are lots of objects in Active Directory. Querying the objects via LDAP is done by different third party applications to (for example) verify users. But sometimes these queries return an error with regard to the sizelimit and not all objects are returned.
 You can change this limit with the ADSI Edit Snap-in. 

CN=Default Query Policy, CN=Query-Policies, CN=Directory Service, CN=Windows NT, CN=Services, CN=Configuration, DC=YOUR_COMPANY, DC=YOUR_COMPANY_TLD

Doubleclick on the lDapAdminLimits. Click on MaxPageSize and remove the entry. Change the entry as shown next :
MaxPageSize=10000


Thursday, August 31, 2017

Install a Windows service using a Windows command prompt

run CMD as Administrator:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe" "c:\myservice.exe"

Tuesday, May 23, 2017

DiskPart to extend a volume from CMD

1: Go to Start, Run, then type

cmd

2:Type
diskpart

3: Type
list volume
to list the current volumes. The list will look like

  Volume ### Ltr Label Fs Type       Size  Status   Info
   ---------- --- ------------------- ----- -------- -------
   Volume 0   C   NTFS Partition      10 GB Healthy  System
   Volume 1   D   Data NTFS Partition  9 GB Healthy  Pagefile

4 Type
select volume <volume number>

to select the volume you want to extend.
5 Type
extend

to extend the selected volume. If you don't pass any parameters, DiskPart will use all unpartitioned space on the current disk. Alternatively, you can type

extent size=<size in MB> disk=<disk number>

to set a size and disk to use for the extension.
6 type
exit

Thursday, May 11, 2017

Create mailboxes Exchange from PowerShell

Create mailboxes from OU Exchange from PowerShell:

Set-AdServerSettings -ViewEntireForest $True
Get-User  -DomainController  dc01.test.local -OrganizationalUnit "OU=Organizations,DC=test,DC=local" | Enable-Mailbox -Database "MBX-name" -AddressBookPolicy "Your ABP"