Tuesday, January 24, 2012

How to send a new Welcome email for Exchange 2010 United Messaging users

I was faced with a challenge today where several users reported that they didn't get their "welcome" email from Exchange when I configured them for Unified Messaging. I looked everywhere in the console for how to resend the email. No Powershell help. Nothing in technet. What to do....

I didn't really want to disable and then enable them. That seems pointless. There has to be a way!!! So I decided to just resent their PIN. Boom...another email was sent out. That is crazy but it worked. They received the email and were able to configure their voicemail.

Here are the steps I took (pretty easy):

1. Open Exchange Management Console
2. Expand "Recipient Configuration"
3. Find the user account that you need to send the email to
4. Right click the user account and choose: "Reset Unified Messaging PIN..."
5. Accept the defaults and click OK on the next screen.
6. This will general a new PIN and send an email to the user.

Here is the PowerShell command:

Set-UMMailboxPIN -Identity "bob ausmus"

Monday, December 5, 2011

External Response Group Call Routing with Lync Server

I stole (er...found) this and it is awesome for Lync. Props to http://blog.kiwibees.net/?p=98


Once you start playing with Response Groups in Lync (or OCS) it probably wont be long before you want one to dial out to your PBX. In my case recently it was to get a support line to call an on-call mobile.

Out of the box, Lync wont.

Any outbound call needs a voice route to determine its routing path and permissions – without one it simply cant go anywhere. In short when the RGS tries to dial out it will default to your global voice policy which (unless you’ve changed it – and you shouldn’t) wont route.

Your first task is to therefore create a voice policy that includes the number (or number pattern) you want to call and define a gateway device.
  • You can do this via the Lync Control Panel or Powershell.
  • Make sure the voice policy is of type ”User” otherwise you wont be able to apply it to your RGS object
  • Make sure you commit the new policy otherwise it wont be available for use (you’ll get a policy is not a user policy error).
Then you need to bind that policy to your RGS object. You definitely need Powershell for this bit.
Grant-CSVoicePolicy -identity “RGSWorkflowObject” -PolicyName VoicePolicyYouCreated
For identity, use the display name of your RGS Workflow object.

And you’re done. Your RGS can now dial out.

Last tip – make sure the number you’re trying to dial out to is entered fully normalised in the format  

+<countrycode><areacode><number>@<sipdomain>.

eg. +6491234567@sipdomain.com

Alternative to the Windows desktop

Are you like several of my friends that like to save EVERYTHING to their desktop? So let me paint the picture for you.... You have 50 documents, pictures, shortcuts, and music files on your desktop with put a picture of you in New York for New Years Eve as the background (example). Then you get mad when you can't find the document that you are trying to find on your desktop. Sound familiar? Is this your desktop?

How are you supposed to find anything in that mess anyway? Everything looks the same. Where is that "HAVE TO HAVE" file that you need for your boss by closing time??? Crap did it download.... I have waited my usual 1/2 second to have it magically appear, I better download it again. Where else, the Desktop. Don't worry, I will move it later (oh no, you fell into that trap as well?). Tell me how many times have you said that and "got busy" and forgot? Me = guilty as well.

I have no problem with saving things to the desktop however I would like to introduce a better place to store things. A little folder called My Documents.  uh.... hello Bob, that will never work. Microsoft puts that folder there for people like you that know computers. Maybe, but they also put things in this folder to assist you in keeping your documents organized so people like me can back them up and find them for you when you computer fails.

Windows Vista introduced a new concept called "libraries" as folder shortcuts. These are a great way to quickly and easily place documents where they can be stored and organized. Which makes finding them later easy. Every Library that you make will show up on the left hand side in the navigation pane when you open or save a file. making it easy to find.

There are some libraries already created for you, such as Documents, Music, Pictures, and Videos. Use these. Microsoft put them there for a reason. They put files in the right spot where they need to go. But Bob.... I don't like these and I just want to put a file somewhere real quick so I can find it. Ok then, let's make a TEMP library where we can do just that.

First we need to create a TEMP a folder that we can include in our new library.

1. Click the start button and click "Documents"
2. Click on the "New Folder" button near the top
3. Type TEMP as the name of the folder

Now to create a library shortcut for this TEMP folder. To do that, follow these steps:

  1. Click the Start button, click your user name (which opens your personal folder), and then, in the left pane, click Libraries.
  2. In Libraries, on the toolbar, click New library.
  3. Type a name for the library, and then press Enter.
  4. Click the name of the library that you just created.
  5. Click the "Include a folder" button
  6. Browse to the TEMP folder you just made. 
Now we have a TEMP library on the side that you can save things in. Plus, since this folder is under the documents directory, it will be easy to backup.

Wednesday, September 28, 2011

Clearing DFS Cache

"Server cannot find network path of DFS name space"

Ever ran into that before on a Windows 2008 Server? That is a great error that tells you nothing. Love it. Thanks Microsoft. That great descriptive error from Microsoft means that the cache for the DFS name space is either pointing to the wrong location to is corrupt. Read on to learn how to fix this error....
 
So your cache is brok-ie no work-ie eh? Here is a quick little command that you can run from an elevated (right click and choose run as administrator) command prompt to "flush" the DFS cache on your local server:

dfsutil cache referral flush

So if you run this from your server right now, it will fail and you will be saying - "What happened???" I did like Bob told me to. That's because you haven't installed the tools that you need on the server to support this command. You need to install the "File Services Tools" on the server. Here's how:

Open Server Manager, under Add Feature, Remote Server Administration Tools (RSAT), Role Administration Tools, File Services Tools

Now close and reopen your elevated command prompt and paste the DFS command in again. Now it should work and clear your cache. No reboot needed.

Here is more information
2008 2003

Wednesday, September 14, 2011

My Favorite "8" Keyboard Shortcuts


Have you ever seen that one "IT" guy that seems to be sooooo fast on the computer that you can't seem to follow him or what he is doing? Next time you see that, pay attention to his hands. I bet they rarely leave the keyboard. I made a decision that I was going to learn to use keyboard shortcuts to accomplish my everyday tasks and I swear it made me faster. I decided to share my top 8 favorite keyboard shortcuts with everyone.

1. Windows key

I love that little Windows key down there on either side of the space bar. That key is so useful to do anything. To open "My Computer" all you have to do is press the Windows key + "E" and BAM there it is. Windows Explorer.


2. Control + an arrow key (either right or left)

You know that you can move the cursor from right to left with the arrow keys but, what if you want to scroll all the way through a line of text. What if I could make it so that you could skip back a word at a time as opposed to a letter at a time. I am here to tell you that pressing Control + arrow key will do just that. Your welcome for the extra time you have to take out the trash and fix dinner.


3. Control + C & Control + V   (Copy and Paste)

An oldie but a goodie. I use this shortcut EVERY DAY - ALL DAY long. I rarely type anything out anymore. Copy and paste baby.

     Control + C = copy
     Control + V = paste


4. F5 (refresh)

Learn to love this key. If you are waiting for an ebay action to end, Facebook to update, or can't wait to read Britney Spears latest tweet....press F5. That will cause the web page (and other things as well) to refresh and give you the latest content. Use it every where on the computer, not just a Internet Explorer. Love it!!!!


5. Control + A (select all)

How many of us love to click and drag, then just to mess up and have to do it over? I want to copy everything from this folder to that one. Press control + A and it will select it all for you. Then use hint #3 with hint #7 to perform the copy and paste. You hands will never leave the keyboard and you will be shocked on how fast it was.


6. Select + An arrow key (either right of left)

Selecting or highlighting a line in a document is hard to do with the mouse. You have to click and  hold and drag and not too far....go back...wait it jumped to another line. Next time try this; put your cursor on the letter right before the word or phrase that you want to highlight, then press and hold down SHIFT and an arrow key. That will highlight one letter at a time. Then use hint #3 to copy and paste it.


7. Alt + Tab (Move between windows)

Ok folks...time to get real. This is the best tip that I can give you. If you press alt + tab it will switch from window to window (application to application). Say for example that you have a letter you are typing open in Word and you found this great tag line from a website that you want to put there. Here is how I would do it without moving my hands from the keyboard:

Hint #6 - Hold down SHIFT and press the right arrow key to highlight the text that I want from the site
Hint #3 - Press Control + C to copy it
Hint #7 - Press Alt + Tab to move to the Word document
Hint #3 - Press Control + V to paste it

This hint will change the way that you use the keyboard. I can have numerous windows open at the same time and with this hint, I can flip back and forth between applications, making me look like I am flying around on a computer. Use this one to show your boss that you deserve that raise!!!!


8. F2 

Ever wanted to change the name of a document without having to click...wait....click......crap......to fast now it is opening. Close it...click...wait...wait...click....ok now I can change the file name. What a pain. Now you can use F2 to rename the file. Highlight (or click once) the name of the file, then press F2. That will allow you to rename. This works in Excel as well, editing the contents of a cell.


Just to prove that it can be done for myself, I typed this whole blog without touching the mouse. Now you can shock and amaze your friends at parties.

Wednesday, September 7, 2011

HTML WebForm with PHP and MySQL - Part 4

Part 4 - PHP Script to insert data into database
Link
Recap: Part 1 | Part 2 | Part 3


Now that we have the database and all of the columns created, we now need to get that data into the database. We can do that with a PHP script.

First we need to build a PHP file that we can edit. Create a new file on your webserver and name it whatever you want (I called mine "pushtodb.php"). Now open that file with your editor of choice. I like notepad++ but you can use whatever is more comfortable for you.

Just like in HTML, we have to open the PHP script with <?PHP (and don't forget to close the tag now so you don't forget later - close it with ?>  ). This tells the browser that you are going to use PHP as oppose to just HTML. 


Lets create a variable to open up a connection to the SQL server. You do that with this command:

     $con = mysql_connect("SQL_server_name","username","password");

Now we have to tell the SQL server which database to use. This command will connect to the SQL server and open up the proper database:

     mysql_select_db("database_name", $con);


Notice the "$con" in that statement? That will take the first statement that we wrote and inject it into this one. Trust me, putting things in variables will make your life a LOT easier as you can reuse the variables throughout the script. 

Time to write that SQL statement that we will actually insert values into the database. Let's make this in a variable named "$sql" so we can use it over and over. At this point (if you read Part 1) you should have all your inputs from your webform in a text file so we can input them in the SQL statement. You have them in notepad++ right??? Right??? Here is the SQL statement; copy and paste this into notepad++ so you can edit it as you need to:



     $sql="INSERT INTO table_name (input_1, input_2, input_3)
     VALUES
     ('$_POST[input_1]','$_POST[input_2]','$_POST[input_3]')";

Ok we have all the connections out of the way, now time for use to actually perform the command(s). Here is the code that will take all the variables we defined and put them in a IF statement:
     if (!mysql_query($sql,$con))
     {
     die('Error: ' . mysql_error());
     }
One more piece of code that we will need now but will make more sense later on:
      $id = mysql_insert_id ( );
Whew. Come on Bob aren't we done yet? Nope, we have three more steps to finish. 
1. Assign the URL that we want people to go to after the script has been ran
2. Setup the email that will alert us when something has been submitted
3. close the SQL connection
Task 1:  Assign the URL

Put this in a variable, I used the variable "$url" but you can use whatever helps you remember what it is.

     $url = 'http://www.domain.com/thankyou.html';

The command that will actually take users to the next page is (look for that variable):

     echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';



Task 2: Setup the email

You are going to see variables from above in this one. You can see why variables are important.

     $emailadd = 'email@yourdomain.com';
     $subject = 'New contract was submitted';
     $body = "This is the body of the email:";
     $text = $body. " " . $id;

     mail($emailadd, $subject, $text, 'From: '.$emailadd.'');

Pay attention to the bottom line. That is the actual command that will send the email out. As you can see, we are building the email with all the variables we make right above it. See that "$id" variable there. I put that in the email in a future lesson we will use that to lookup this form. We need a place holder that we can call this specific form from the database, and since ID is always unique, its the perfect one to use. 



Task 3: Closing the SQL connection (the easy one)

You are going to find this a real challenge. Here is the code (look for the variable that we assigned earlier):

    mysql_close($con)


At the bottom of the script you should see (if you followed directions from above) the ?> to close the PHP script. 

That's it. Post that to your site and give it a shot. Let me know if it works!!!! Good luck.

Thursday, August 25, 2011

Showing Advanced Features in Active Directory


I edit SPN's a lot with MS SQL server and I was sick of using ADSIedit so I found that the ADMINPAK for Windows 7 would allow me to edit the SPN's directly. Only problem is that you can't see the "Attributes" tab in Active Directory Users and Computers (ADUC) without turning on the advanced features. Here is how I turned them on:

1. Open Active Directory Users and Computers (Start -> Run -> type: dsa.msc -> Ok)

2. Click on "View" then check "Advanced Features"



Now you can see the "Attributes" tab as well as a lot of other tabs that make editing user profiles a lot easier for the lonely sys-admin.