Curtis Johnstone Curtis Johnstone's Personal Blog

January 27, 2011

Microsoft PowerShell Single Quote vs Double Quote

Always having to remind myself of this when I write powershell scripts:

  • Single quotes return a literal string consisting of whatever is enclosed between them – there is no evaluation.
  • Double quotes evaluates the string; it will expand and variables that you have enclosed.

Example:

$month = ‘May’

Write-Host “The current month is $month”

> Output = The current month is May

Single quotes return a literal string consistening of whatever is enclosed between them – there is no evaluation.
Double quotes evaluates the string; it will expand and variables that you have enclosed.
E.g.
$month = ‘May’
Write-Host “The current month is $month”
Output = May
PowerShell Line Continuation with the Backtick
The Backtick’ character (`), tells the PowerShell parser to continue the command on the next line.
GOTCHA:  You need one space character BEFORE it, and no extra characters after it, for it to work.

Microsoft PowerShell Line Continuation with the Backtick

The Backtick’ character (`), tells the PowerShell parser to continue the command on the next line.
GOTCHA:  You need one space character BEFORE it, and no extra characters after it, for it to work

The Backtick’ character (`), tells the PowerShell parser to continue the command on the next line.

GOTCHA:  You need one space character BEFORE it, and no extra characters after it, for it to work.

January 13, 2011

Changing the Default Password Policy in Windows Server

In a lab environment, you may want to relax the password requirements for easy of testing.

Follow these steps to disable the Password Complexity policy:

If you are on a Windows 2008 or newer Server Version:

  1. Click Start and type gpmc.msc and hit enter.  This starts the Group Policy Management Console.
  2. In the left-hand tree, expand the Forest node, the Domains node, and expand the Domain node for the domain that you want to change the password policy.
  3. Right-click on “Default Domain Policy” and select Edit.  This launches the Group Policy Management Editor focused on the domain.
  4. In the left-hand tree, expand Computer Configuration | Policies |  Windows Settings | Security Settings | Account Policies and select the Password Policy node.
  5. Edit the “Password must meet complexity requirements” policy, select Disabled and Apply the change.
  6. To apply the Group Policy change immediately, either restart the domain controller or open a command prompt, type the following command, and then press ENTER:
    gpupdate /force
  7. To apply the Group Policy change immediately issue a “gpupdate /force” command (either on the command line or from the Start menu).

Note: from the “Local Security Policy” (secpol.msc) on a member Windows 2008 R2 Server, these settings will be locked and connot be changed because they are set at the domain level.

If you are on a Windows 2000 or Windows 2003 server:

  1. Edit the Domain Security Policy. This is best done on a Domain Controller.  Start  the Domain Security Policy console: Start | Programs | Administrative Tools.
    • Note: this console is the GUI equivalent of the dompol.msc command line but you’ll want to start it from the Start menu because dompol.msc takes a parameter that is the distinguished name of the domain security policy which is difficult to get.
  2. Under Security Settings select Account Policies | Password Policy.
  3. Set the “Password must meet complexity requirements” to “Disabled”.
  4. You can optionally leave the above setting “Enabled’ and tweak the other password requirement settings. Enter a value if “0” (zero) for the other settings essentially makes the setting not applicable.  For example, setting the Minimum password length setting to “0”, makes it so no password is required.

The Domain Security Policy editor is available on Windows 2003 Server. It was deprecated in Vista, Windows 7, Windows 2008, and Windows 2008 R2, and newer operating systems.

January 7, 2011

GUI and User Design Tools

Filed under: Technology — admin @ 10:49 pm

Some Visual GUI Sketching and Prototyping Tools:

  1. SketchFlow
  2. Balsamiq
    • Fantastic and easy to use, but very rustic.  Not quite as feature rich as other solutions.
    • $79 USD.   Take a free web tour and try it out.
  3. Axure
    • Can create everything from sketchy concepts to full simulation.
    • Can export to HTML prototypes.
  4. Pencil
    • A little too simplistic for my visual design needs.
  5. IxEdit
    • Low-level, requires HTML coding.
    • Not really a good design, sketch tool

December 1, 2010

How To Enable Multiple Desktop Sessions in Windows 2008 R2

By default in Windows 2008 R2, you can only have one remote desktop session.

Enable Multiple Remove Desktop Sessions

There are 2 ways to enable multiple remote desktop sessions.

1. Configure it in “Remote Desktop Session Host Configuration”.

To configure the number of simultaneous remote connections allowed for a connection
] On the RD Session Host server, open Remote Desktop Session Host Configuration: Start | Administrative Tools | Remote Desktop Services | Remote Desktop Session Host Configuration.
] Under “Edit settings” double-click “Restrict each user to a single session” to edit the Properties.
] Deselect the “Restrict each user to a single session” checkbox.

To configure the number of simultaneous remote connections allowed for a connection

  • On the RD Session Host server, open Remote Desktop Session Host Configuration: Start | Administrative Tools | Remote Desktop Services | Remote Desktop Session Host Configuration.
  • Under Connections, right-click the name of the connection, and then click Properties.
  • In the Properties dialog box, on the Network Adapter tab, click Maximum connections, enter the number of simultaneous remote connections that you want to allow for the connection, and then click OK.

If the Maximum connections option is selected and dimmed, the Limit number of connections Group Policy setting has been enabled and has been applied to the RD Session Host server.

See Configure the Number of Simultaneous Remote Connections Allowed for a Connection for more information.

OR

2. Configure it in Group Policy

  • Launch the Local Group Policy Editor (gpedit.msc)
  • Navigate to Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections
  • Configure the “Limit Number of Connections” to the number of connections you want to support.

Allowing the Same User to have Multiple Sessions

If you want to allow the same AD credentials to each have their own sessions, there is one more setting:

  • On the RD Session Host server, open Remote Desktop Session Host Configuration: Start | Administrative Tools | Remote Desktop Services | Remote Desktop Session Host Configuration.
  • Under “Edit settings” double-click “Restrict each user to a single session” to edit the Properties.
  • Deselect the “Restrict each user to a single session” checkbox.

Other Useful Notes and Links

A good support article: Changes to remote administration in Windows Server 2008 (http://support.microsoft.com/kb/947723). This describes the changes to the “/admin” and “/console” switches.

Remote Desktop Connection (RDC) 7.0 (Windows 7) supports the following:

  • multiple monitors
  • audio and video playback

This is only applicable when using an RDC 7.0 client connecting to a Windows 2008 R2 server.

See Remote Desktop Client Experience in Windows 2008 R2 (http://technet.microsoft.com/en-us/library/dd560636(WS.10).aspx) for more information.

Multiple Monitor Support: click “Use all my monitors” in the RDC client

Audio and Video: use the Client experience configuration page in Service Manager.

The client experience configuration page allows you to configure the following functionality:

  • Audio and video playback redirection. Audio and video playback redirection allows users to redirect the audio and video output of a local computer to an RD Session Host session
  • Audio recording redirection. Audio recording redirection allows users to redirect the output of an audio recording device, such as a microphone, from the local computer to an RD Session Host session
  • Desktop composition. Desktop composition provides users with the user interface elements of the Windows® Aero® desktop experience within their RD Session Host session.

Note: configuring any of these features also installs the Desktop Experience role service and starts the Windows Audio service on the RD Session Host server.

November 21, 2010

What Information Are you Revealing on the Internet?

Filed under: Technology — Tags: , , — admin @ 9:38 pm

Each time you visit a web site, by default, the following information is usually available to the web site:

  • Your Internet IP address (i.e. of your internet connection)
  • Your computer IP address
  • Your computer Hostname
  • Your operating system & version
  • Your browser type and version
  • Your Internet provider
  • Connection speed

With your Internet IP address, usually the following can be calculated:

  • Your location:  Country and City or Area

Try it out for yourself, and see what information is available about you:

http://www.ip2location.com/

http://www.ip-adress.com/ip_tracer/

http://ip-address.cc/

Also check-out these tools: http://www.yougetsignal.com/

A great tool to protect your privacy and defend yourself against network surveillance and traffic analysis is The Tor Project.

August 26, 2010

How do I lock rotation with iOS 4 / iPhone OS 4?

The iOS 4 firmware update includes a rotation lock feature, similar to the rotation lock switch found on the first generation iPad.
iPhone 4 ships with iOS 4 and also has this capability. To enable rotation lock and prevent the screen from automatically changing orientation when the iPhone is turned:
1. Double click the home button to bring up the multitasking bar.
2. Swipe right until the last set of icons is displayed in the multitasking bar (these will include play/pause and skip buttons for iPod or Pandora).
3. The furthest left icon looks like a circular arrow – touch this icon to enable or disable rotation lock on the iPhone.
4. A rotation lock icon will appear in the status bar next to the battery charge icon when rotation lock is enabled. This looks like a circular arrow around a padlock.

When rotation lock is enabled apps will not respond to the accelerometer sensor.

The iOS 4 O/S update includes a rotation lock feature, similar to the rotation lock switch found on the first generation iPad.

The iPhone 4 firmware update has the ability to lock the rotation feature so that all applications stay in portrait mode.

To enable rotation lock and prevent the screen from automatically changing orientation:

1. Double click the home button to bring up the multitasking bar.
2. Swipe right until the last set of icons is displayed in the multitasking bar (these will include play/pause and skip buttons for your music application).
3. The icon on the far left looks like a circular arrow – touch this icon to enable or disable rotation lock on the iPhone.
4. A rotation lock icon will appear in the status bar next to the battery charge icon when rotation lock is enabled. This looks like a circular arrow around a padlock.

When rotation lock is enabled apps will not respond to the accelerometer sensor.

April 10, 2010

iPhone OS 4 Significant Changes

Filed under: Technology — Tags: , — admin @ 11:12 pm

Apple released a Beta of it’s new operating system for the iPhone recently.  Here are some notable changes courtesy of: http://www.ilounge.com/index.php/articles/comments/new-in-iphone-os-4-the-full-app-by-app-breakdown/

Mail. Opening mail to the inside mailbox view looks the same as before in portrait or landscape, but backing up to your multiple mailbox view has changed. Now Mail aggregates the contents of all of your inboxes into one master inbox, letting you back out from that inbox to separate inboxes and individual mail accounts instead. Choose an individual account and you see all of the mailboxes—outgoing, inbox, drafts and any additional folders.

Camera. The Camera application now has digital zoom capability; you can pinch or tap-and-hold to activate the digital zoom feature, and a slider appears on screen to let you set the zoom level. Not surprisingly, the results look crummy. Tap to Focus has been added to video recordings. Support for a hardware-based flash has been discovered by developers probing the iPhone OS 4 code.

Maps. The terrain view added to Maps on the iPad is not available in the iPhone and iPod touch version of the Maps app. Only one obvious change has been made: the compass icon has changed to the Northeast-pointing arrow icon used for Location Services.

April 9, 2010

Windows Media Player – Supported Types and Codecs

A good simple explanation of the various media file types and which are supported in Windows Media Player, including sample files for each media type to test whether they are supported in your Windows Media Installation:  Information about the Multimedia file types that Windows Media Player supports.

A good reference about Codes on the windows platform: Microsoft Windows – Codecs: frequently asked questions.

February 5, 2010

Google News Archive

Filed under: Technology — Tags: — admin @ 10:31 am

One of the many amazing things Google is doing is making complete archives of various news media (like newspapers) available on-line.

For example, the complete archive of the Ottawa Citizen newspaper was recently made available. Approximately 2.5 million articles are available dating back to 1890.

> news.google.ca/archivesearch/advanced_search

« Newer PostsOlder Posts »

Powered by WordPress