Friday, December 9, 2011

Administrator cannot change, delete or take ownership of file

Problem: It is well known that if a file is locked in Windows, an administrator can take control of the file by taking ownership of it, give himself permissions to write/delete it and then perform pretty much anything he needs to do with the file. Sometimes, however, you just receive an error message when you try to take ownership, even though you are an administrator, and even though the command prompt or Windows Explorer you are working from has been started by right-click - "Run as administrator"

Solution: Open Computer Management and open shared folders - open files. If the file in question is being held by someone that has opened the file over a fileshare, you first have to terminate their connection to the file before you can manipulate it. Of course, you should first make sure you are not disturbing any work they are doing on the file.

Tuesday, October 4, 2011

Cannot connect to any computer except DC

Problem: The only network traffic (ping etc.) that could pass in a Win7/Server 2008 R2 domain was from each client computer to the domain controller. No client computer could contact each other. Even the domain controller could not initiate contact towards a client computer.

Reason: In the Server 2008 R2 active directory domain organizational unit (OU), a Group Policy Object (GPO) had been created to disable the local client's firewall and allow any network traffic (which was ok from a security point of view, since the network was completely disconnected from anything outside). When applied, the firewall was indeed not started, but somehow the idea backfired by blocking all but those client computer connections made to the DC.

Solution: The Firewall service was reenabled in the GPO:
Policies-Windows Settings-Security Settings-System Services-Windows Firewall-Startup type=Automatic
Instead the Firewall setting was set to off for the domain profile (which is the active profile for computers within a domain):
Policies-Windows Settings-Security Settings-Windows Firewall with Advanced Security-Domain Profile Settings-Firewall state = off

It seems absolutely illogical to me that switching off the firewall service would block most network traffic. Maybe some special case in my domain caused it - nevertheless, there was no doubt that my changes were the solution to my problem - even proven by the fact that reversing them would lead to reintroducing the problem.

Saturday, September 10, 2011

PHP scripts stopped working when moved

Problem: After having moved some PHP scripts from one web server to another, they stopped working , or only worked partially. One of the webpages showed all the HTML and the upper part of PHP generated code, but strangely after a certain point the rest of the PHP code had just been ignored.

Solution: I loaded one of the script files in the open source DevPHP editor and chose Format on the menu. The Mac (CR) option was checked. I changed it to Windows (CRLF), uploaded the file again and reran it. Voilla, it worked!

Obviously, some PHP parsers may be more picky than others with how they read line breaks.