Kayıtlar

Display entries in Windows DNS cache

DNS search results are cached on local systems to prevent a lookup every time the search is required. Sometimes during troubleshooting it is helpful to see the contents of the DNS client cache. This recipe describes the process of viewing the Windows DNS cache. To view the DNS cache on the local system, type the following command from a command prompt: ipconfig /displaydns | more The  | more  is optional and will pause the output after each screenful which may be helpful since the DNS cache can get large and the output format uses several lines per record. A sample output from this command is shown below. This is an address lookup for the host microsoft.com. The  Record Name  and  A (Host) Record  lines show the request and answer. The  Time To Live  field shows the number of seconds before this entry expires. microsoft.com —————————————- Record Name . . . . . : microsoft.com Record Type . . . . . : 1 Time To Live  . . . ....

Command to Create a Dummy File

Dummy files can be very helpful in a Server environment. For example, having a 5 GB dummy file on the log and database partitions of an Exchange Server will help you resolve a space issue quickly. Simply delete the dummy file, and then you’d have some time to address the issue properly. Use below Windows Commands to create dummy files in a size of your choice. 1 GB dummy file (1024*1024*1024=1073741824): fsutil file createnew dummy.file 1073741824 5 GB dummy file (1024*1024*1024*5=5368709120): fsutil file createnew dummy.file 5368709120

Configuring BDE for Windows 7

Resim
Windows 7 can be very restrictive towards applications written for the previous versions of Windows. This is the case with the  Borland Database Engine (BDE) , which is not capable of running in Windows7 unless two settings have been changed: A permission for the BDE must be given in the windows registry database. A BDE attribute named “Net Dir” must be configured to an arbitrary folder other than the root drive (C:). This configuration is done in the “BDE Administrator” program that’s installed with the BDEInfoSetup utility. 1. First, configure the permission for the BDE in the registry… Make sure you are logged into your Windows7 machine with an administrator account. Then follow these directions: Go to Start | Run… Type regedit… Open the HKEY_LOCAL_MACHINE branch. Open the SOFTWARE branch. Right-Click on the entry labeled “Borland”. In the menu that shows select Permissions. The following dialog will appear: Click “Users”. Under “Permissions for Users ...

Resetting NTFS Permissions in Windows 7

Here’s the scenario. A friend of mine gave me his old disk drive to have it copied to a new drive. The old drive had permissions set on files and folders. Some of the files were not accessible, I was getting “Access Denied”. I tried to right-click/properties on the folders that were not accessible and changed their owner and changed permissions but some folders were still inaccessible not matter what I did. After some research, it turned out the tool “cacls” that allows one to display or change ACLs (access control lists) can help to reset ACLs. In Windows 7 it is called “icalcs”. To reset files permissions simply do this: Run “cmd” as Administrator Go to the drive or folder in question, for example: cd i: To reset all the files permissions, type: icacls * /T /Q /C /RESET That is it! After that, the files permissions were reset and I could access them just fine. icacls is a handy tool to change permissions of files en masse.

Test-Run a PowerShell or Exchange Management Shell Command

Exchange Management Shell/PowerShell commands allow the addition of the “-whatif” parameter, which will test your command without actually executing it. Example :  Set-Mailbox -Identity testmailbox -DisplayName “Test User”  -whatif

File Content Search in PowerShell

There is a way to use Powershell to search the contents of a file.  This method will not use the Windows index so it will be slow, but it does work. get-childitem c:users -filter *.txt -recurse | select-string -list -pattern “yourtext” | foreach {$_.Path} Explanation get-childitem : Get the children for a container.  In this example the container is a folder on the file system. The first argument is the directory to search (c:users). The –filter switch is used to limit what files to search, in this example it will search files with a txt extension. Process all sub-directories with the –recurse switch. select-string : Find text in strings or files. The –list switch stops the search within the source once the match is found.  In other words it will not waste time looking for other occurrences of the text. The –pattern switch is where you specify the search text.  Regex is permitted. foreach :  Iterate the resulting files. $_.Path :  Outp...

File Name Search in PowerShell

Here a simple but effective command to retrieve a list of all files in a directory tree containing a specific text in the file name. dir c:users -r -i “*yourtext*” Explanation The first argument is the directory to search (c:users). Process all sub-directories with the –r switch. The -i switch is used to specify which file names to search for, in this case all files containing yourtext