Posts

Showing posts with the label cmd

Replace inheritance permissions on folder/file using commandline in Windows server 2008

When you create a new folder or file (B) inside an existing folder (A) in Windows environment (It's Windows Server 2008 R2 in my case), B will inherit all the security access permissions of A. And you don't want that happen just like me. You can run this command in cmd to replace all the inherited aces (access control entries) from B with different ace set (the following will replace all the inherited trustee with domain admins and local administrators): icacls "\path\to\folder\or\file" /inheritance:r /grant:r "MYDOMAIN\Domain Admins":(OI)(CI)F /grant:r "Administrators":(OI)(CI)F /T Please be noticed that if you run this command via a bash shell (cygwin) instead of the Windows's cmd, you have to escape the "\", "(", and ")" characters: icacls "\\path\\to\\folder\\or\\file" /inheritance:r /grant:r "MYDOMAIN\\Domain Admins":\(OI\)\(CI\)F /grant:r "Administrators":\(OI\)\(CI\)F /T ...

How to see your motherboard info from Windows 7

In Windows 7, you can find out your computer's motherboard information by running this command in cmd: wmic baseboard get product,Manufacturer,version,serialnumber Quite easy huh?

Start/stop Apache service in Windows's command line

Image
To start/stop Apache service in Windows use these following commands: Open command prompt (Start > cmd): To stop apache: C:\ net stop apache2.2 or to start apache: C:\ net start apache2.2 Not quite convenient but at least It makes me feel like doing things in linux.

Active Directory DC - How to solve error 8614 and eventID 2042

Image
One day, you wanna rename a domain controller in the forest just like me did a couple days ago. You wanna make sure everything OK before making any changes to the system using  repadmin tool (included in Windows Server 2008): > repadmin /showrepl But, a domain, called it DC-A, in the forest raises the 8614 error indicates that: "The Active Directory cannot replicate with this server because the time since the last replication with this server has exceeded the tombstone lifetime" Oops...! In this situation, to troubleshoot, I suggest that you should use 2 tools of the Windows server environment:

Window$ - How to increase the size of the cmd window.

Image
It's just absolutely annoying when I have to work with the Windows's command prompt windows because of its limited size. To increase the size of the command prompt window of M$ Windows: 1. Right click in the control bar of the windows, choose Properties: