Kayıtlar

Eylül, 2012 tarihine ait yayınlar gösteriliyor

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  . . . . : 3597 Data Length . . . . . : 4 Section . . . .

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 “, select

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 :  Output the full path for the file

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

Repair Corrupted Outlook PST File

If you can’t open your Personal Folders file (.pst) or you suspect that your .pst data file is corrupt, you can use the Inbox Repair tool (Scanpst.exe), to diagnose and repair errors in the file. Instructions for both Outlook 2003 and Outlook 2007 are given below. Outlook 2003 Close Outlook if it’s running Open folder “drive:Program FilesCommon FilesSystemMSMAPILocaleID” (drive is normally the C drive, and LocaleID is the locale identifier (LCID) for the installation of Microsoft Office. The LCID for English – United States is 1033) Double-click Scanpst.exe Select the PST file to scan by using the “Browse” button Click Start When the scanning is completed, and if errors were found, you will be prompted to start the repair process If required, change the location of the backup file in the Backup File Box Click Repair Start Outlook using the profile that contains the .pst file that you tried to repair The Lost and Found folder contains folders and items that the Inbox Repai

Setup U-Turn (Hairpinning) on Cisco ASA

U-Turn (Hairpinning with static NAT) is used for making the outside interface (the one that points to the Internet) of an ASA device available to inside users. Let’s say you have enabled inbound http traffic on the outside interface, such as Static NAT to an inside Web server. By default, inside users wouldn’t be able to connect to that port on the outside interface, the ASA device wouldn’t have a path to route the traffic properly. This is  a when the U-Turn feature comes into play. It enables the ASA device to route traffic from inside users the same way as if the traffic would come from outside. Caution : Carefully consider the expected amount of traffic and the capabilities of your ASA device before you implement this solution, because it involves sending all traffic between the client and the Web server through the ASA device. Step 1 : Enabling traffic of same security level to pass same-security-traffic permit intra-interface This command enables traffic of the same sec

Clear Cisco Router Logs

To clear the router’s log, use this command in enable mode: clear logging

Clear DNS Cache Manually

When you use DNS to resolve hostnames to IP addresses or services end point addresses, you sometime may want to clear the DNS cache manually. On  Windows  you can clear the DNS cache with the “  ipconfig /flushdns   ” command. On  Cisco  gear you can use the “  clear hosts *   ” in enable mode.

Group Nesting Table

The table below shows which types of groups can be nested into other groups. Group Type Can Be Nested into Local Can Be Nested into Domain Local Can Be Nested into Global Can Be Nested into Universal Local No No No No Domain Local Yes Yes, if in the same domain No No Global Yes Yes Yes, if in the same domain Yes Universal Yes Yes No Yes

500 – Internal Server Error when using OWA with /exchange

The 500 – Internal Server Error is displayed when you access Outlook Web Access from https://CASServer/exchange  while  https://CASServer/owa  works fine. This happens when you have separate Exchange 2007 Mailbox and CAS servers. Ideally the request should be redirected to /owa but you get the 500 – Internal Server Error right after typing in your credentials in the forms login page. The redirection is not working because  ISAPI Extensions are not installed on the Mailbox Server . ISAPI extensions handle specific incoming requests to the IIS server. The extensions are loaded when they are first needed and kept in memory until the host process shuts down. To fix this issue, install the ISAPI Extensions on the mailbox server. This can be done by using the following command: ServerManagerCmd -i Web-ISAPI-Ext When the install is complete, restart IIS.

Create Mailbox Size and Item Count Report

Here’s an Exchange Management Shell command that generates a report with mailbox sizes and item counts of all mailboxes within the Exchange Organization, sorted by mailbox size: Get-MailboxStatistics | Sort -Property TotalItemSize | ft DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label=”Mailbox Size (MB)”}, itemcount If you require to have this report exported to a text file, the command below will do the trick. Get-MailboxStatistics | Sort -Property TotalItemSize | ft DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label=”Mailbox Size (MB)”}, itemcount > C:MailboxSizeReport.txt

Recreate Exchange IIS Virtual Directories

If you’re in need to recreate the IIS virtual directories of Exchange Server, below commands will do exactly that. Launch the Exchange Management Shell on the CAS server and enter below commands as needed. “Exchange (Default Web Site)” Remove-OwaVirtualDirectory “exchange (Default Web Site)” New-OwaVirtualDirectory “exchange” -OwaVersion Exchange2003or2000 -VirtualDirectoryType Mailboxes -WebSiteName “Default Web Site” “Exchweb (Default Web Site)” Remove-OwaVirtualDirectory “exchweb (default web site)” New-OwaVirtualDirectory “exchweb” -OwaVersion Exchange2003or2000 -VirtualDirectoryType Exchweb -WebSiteName “Default Web Site” “OWA (Default Web Site)” Remove-OwaVirtualDirectory “owa (default web site)” New-OwaVirtualDirectory -name “owa” -OwaVersion Exchange2007 -WebSiteName”Default Web Site” “Public (Default Web Site)” Remove-OwaVirtualDirectory “public (default web site)” New-OwaVirtualDirectory “public” -OwaVersion Exchange2003or2000 -VirtualDirectoryTy

Changing Mailbox Type of an existing Mailbox

You might have encountered the case where you (or someone else) created a regular mailbox, that should have been a shared mailbox? There is help. The type of mailbox can easily be changed by using the appropriate Exchange Management Shell command from below. Regular Mailbox Set-Mailbox -Identity {Mailbox Name} -Type Regular Room Mailbox Set-Mailbox -Identity {Mailbox Name} -Type Room Equipment Mailbox Set-Mailbox -Identity {Mailbox Name} -Type Equipment Shared Mailbox Set-Mailbox -Identity {Mailbox Name} -Type Shared Note:  There might be further setting changes required in addition to above commands, i.e. for a shared mailbox: granting people access, for room mailboxes: setup of auto-accept features etc.

Change Mailbox Display Name to Format “Lastname, Firstname”

By default the Display Name of Exchange Mailboxes is in the format of “Firstname Lastname”. To change this for an existing mailbox to “Lastname, Firstname”, use the Exchange Management Shell command below. Get-Mailbox “User Name” | Get-User | ?{ $_.Lastname -ne $null } | %{ $dispName=$_.LastName + “, ” + $_.FirstName ; set-mailbox $_.SamAccountName -Displayname $dispName } In case you want to revert back to the format “Firstname Lastname”, here’s the command for that. Get-Mailbox “User Name” | Get-User | ?{ $_.Lastname -ne $null } | %{ $dispName=$_.FirstName + ” ” + $_.LastName ; set-mailbox $_.SamAccountName -Displayname $dispName }

Configure OWA Time-Out Values

Viewing  the current time-out values can be done by running the following PowerShell commands: “This is a Public Computer” setting get-ItemProperty ‘HKLM:SYSTEMCurrentControlSetServicesMSExchange OWA’ -name PublicTimeout “This is a Private Computer” setting get-ItemProperty ‘HKLM:SYSTEMCurrentControlSetServicesMSExchange OWA’ -name PrivateTimeout Use below PowerShell commands to  set  the values: “This is a Public Computer” setting se t-ItemProperty  ‘HKLM:SYSTEMCurrentControlSetServicesMSExchange OWA’ -name PublicTimeout -value -type dword “This is a Private Computer” setting set-ItemProperty ‘HKLM:SYSTEMCurrentControlSetServicesMSExchange OWA’ -name PrivateTimeout -value -type dword Note:  You must restart Internet Information Services (IIS) by using the command  iisreset /noforce for these changes to take effect.

Display or Export the Members of Exchange Distribution Groups

The members of Distribution Groups can be viewed and modified through the Outlook Address Book. However, Outlook doesn’t offer a way to export a list of all the members. Administrators can run the following Exchange Management Shell commands to display/export the memberlist, sorted by DisplayName. Single Distribution Group Display Memberlist Get-DistributionGroupMember {Name of Group} | Sort -Property DisplayName | Select DisplayName, Alias, Department Export Memberlist to TXT file Get-DistributionGroupMember {Name of Group} | Sort -Property DisplayName | Select DisplayName, Alias, Department > C:DGmemberlist.txt Export Memberlist to CSV file Get-DistributionGroupMember {Name of Group} | Sort -Property DisplayName | Select DisplayName, Alias, Department | Export-CSV C:DGmemberlist.csv All Distribution Groups in the Exchange Organization Display Memberlist (create a script file called something like C:scriptsGet-DGmembers.ps1, paste below commands into it, and run