Showing posts with label Windows Server. Show all posts
Showing posts with label Windows Server. Show all posts

Thursday, July 5, 2018

Extend Volume failed, but partition was extended

If you extended disk but space doesnot added to partition

Open CMD as administrator:

  1. diskpart
  2. list volume
  3. select volume x
  4. extend filesystem

Wednesday, May 30, 2018

Export File server Permissions to CSV

Export share folder Permissions to CSV file using powershell:


 $FolderPath = dir -Directory -Path "\\sharefolderPath" -Recurse -Force
 $Report = @()
 Foreach ($Folder in $FolderPath) {
     $Acl = Get-Acl -Path $Folder.FullName
     foreach ($Access in $acl.Access)
         {
             $Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD
 Group or
 User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
             $Report += New-Object -TypeName PSObject -Property $Properties
         }
 }
 $Report | Export-Csv -path "C:\tmp\FolderPermissions.csv"

Thursday, April 12, 2018

Remote Desktop Application use Remote server Keyboard layout

In Remote desktop application cannot switch keyboard layout, there is only ENG keyboard, and you cannot switch to your computer keyboard layout.
To fix this add keyboard layout, what you want on terminal server and add to registry dword.

Open regedit on terminal server:

add new Dword  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout

"IgnoreRemoteKeyboardLayout"=dword:00000001 

Monday, February 12, 2018

Enabling Disk Performance Counters in Windows Server 2012 R2 Task Manager

  1. Ensure Task Manager is closed.
  2. Launch the Command Prompt using the "Run as Administrator" option. 
  3. Enter the following at the Command Prompt:  diskperf -Y

Tuesday, November 28, 2017

“The RPC server is unavailable” while trying to take Remote Desktop of 2003 Server

When trying to logon to Windows server 2003 via remote desktop you receive the following message:

The system cannot log you on due to the following error:
The RPC server is unavailable.
Please try again or consult your system administrator.

You will also receive the following event in the target server’s application event log:

Event ID: 1219
Logon rejected for Domain\User. Unable to obtain Terminal Server User Configuration. Error: The RPC server is unavailable.

To resolve this :

1. Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
2. Create a new DWORD called IgnoreRegUserConfigErrors
3. Give it a value of 1

Source

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





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

Tuesday, January 17, 2017

Cann't connect Admin Share member of administrators group

\\servername\c$
Can connect to it using the default Administrator account. But if I try to connect using  account that is a member of the Administrators group,  can't.
create the LocalAccountTokenFilterPolicy DWORD value at this key in the registry
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\
0 - build filtered token (Remote UAC enabled) 
1 - build elevated token (Remote UAC disabled)

or you can add this key from CMD :

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Thursday, September 22, 2016

DFS Replication problem -FIX

1. Connect to PDC domain controller:

Open services.msc --- and stop DFS Replication service

2. Open ADSI Edit (adsiedit.msc)
 connect to PDC
 go to ---
CN=SYSVOL Subscription,CN=Domain System Volume,CN=DFSR-LocalSettings,CN=<PDC Server >,OU=Domain Controllers,DC=<your domain>

change attributes :
msDFSR-Enabled=FALSE
msDFSR-options=1


on all other domain controllers change 
4. msDFSR-Enabled to  False

on PDC run :

5.repadmin /syncall pdc_name /APed

6. start  DFS Replication service

7. Go to ADSIEdit and change back msDFSR-Enabled to True
8. run DFSRDIAG POLLAD (on PDC)
9.  on all other Domain controllers run 

repadmin /syncall pdc_name /APed

10.  on all other DC (not PDC) change in ADSIEDIT msDFSR-Enabled to True
11. run on all DC (not PDC) DFSRDIAG POLLAD

Source

DFS Replication problem -FIX

1. Connect to PDC domain controller:

Open services.msc --- and stop DFS Replication service

2. Open ADSI Edit (adsiedit.msc)
 connect to PDC
 go to ---
CN=SYSVOL Subscription,CN=Domain System Volume,CN=DFSR-LocalSettings,CN=<PDC Server >,OU=Domain Controllers,DC=<your domain>

change attributes :
msDFSR-Enabled=FALSE
msDFSR-options=1


on all other domain controllers change (not PDC)
4. msDFSR-Enabled to  False

on PDC run :

5.repadmin /syncall pdc_name /APed

6. start  DFS Replication service

7. Go to ADSIEdit and change back msDFSR-Enabled to True
8. run DFSRDIAG POLLAD (on PDC)
9.  on all other Domain controllers run 

repadmin /syncall pdc_name /APed

10.  on all other DC (not PDC) change in ADSIEDIT msDFSR-Enabled to True
11. run on all DC (not PDC) DFSRDIAG POLLAD

Source

Tuesday, August 23, 2016

Changing default number of machines users can add to a domain

The Active Directory attribute you need to change is mS-DS-MachineAccountQuota which is a property of the domain object. 
– Start ADSI Edit (start/run/adsiedit.msc)
– Expand out the Domain node, right click on DC=<yourdomain>,DC=com and select properties
– Scan down to ms-DS-MachineAccountQuota
– Modify the value as appropriate, or clear the value to remove the limit entirely.

Tuesday, July 19, 2016

Remove Windows Failover Cluster

Run powershell as an administrator
Import-Module FailoverClusters
then clear-clusternode
run this commands on all nodes.

Remove Windows Failover Cluster

Run powershell as an administrator
Import-Module FailoverClusters
then clear-clusternode
run this commands on all nodes.

Wednesday, April 20, 2016

Upgrade Windows Server 2008 R2 From Standart to Enterprise

View Current installed Version
DISM /online /Get-CurrentEdition

View versions available for upgrade
DISM /online /Get-TargetEditions

for upgrade 
DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

DISM /online /Set-Edition:ServerEnterprise /ProductKey:489J6-VHDMP-X63PK-3K798-CPX3Y

Restart Computer

Monday, February 29, 2016

How to Reset Administrator Password in Windows Server 2008

Boot server from Microsoft Windows Server 2008 DVD.

From the Install Windows Menu click “Next” .

Select “Repair your Computer”.

In the System Recovery Options, Select the Operating System instance that you wish to repair and click “Next”.

Select “Command Prompt”.
 At the Command Prompt, run the following Commands:
C:\>
           C:\>cd windows
           C:\WINDOWS\system32>
           ren Utilman.exe Utilman.exe.old
           copy cmd.exe Utilman.exe

Reboot the Server allowing Windows to load normally.

At the Logon Screen, Press Windows Key + U.

At the Command Prompt, Enter following command:

net user administrator 123-zxc

This will set the Password for the Administrator user to be 123-zxc

Saturday, January 30, 2016

Server Core configuration from CMD

Network Configuration :

netsh
interface
ipv4
show interfaces



Select INx  (name - is selected index) for example 4

set address name=″4″ source=static address=192.168.0.50 mask=255.255.255.0 gateway=192.168.0.1


DNS Configuration:

If there is several dns servers set  index=1,2…

add dnsserver name=″4″  address=192.168.0.10 index=1

exit.

Set Hostname:

netdom renamecomputer WIN-FDP41E28535 /newname:SERVER1

Reboot Computer

shutdown -r -t 0


Join Computer to Domain

netdom join Server1 /domain:contoso.com /UserD:administrator@contoso.com /PasswordD:*


Create Firewall Rule:

netsh advfirewall firewall set rule group=″Remote administration″ new enable=yes

cscript C:\windows\system32\scregedit.wsf  /ar 0


OR Use SCONFIG 







Friday, January 29, 2016

Windows Server 2012 Install-Remove GUI


Install:

Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Restart

Remove:

Remove-WindowsFeature Server-GUI-Shell, server-gui-mgmt-infra -Restart

Wednesday, January 13, 2016

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

install framework 3.5 on server 2012

dism /online /enable-feature /featurename:NetFX3 /all /Source:d:\sources\sxs /LimitAccess