Office/Excel Tip: Add cell value to text string, including inverted commas

I have a spreadsheet with the Active Directory current_ObjectID attribute in column H and the new_ObjectID I want to apply in column J.

The powershell script to make the change I want is this:

Rename-ADObject –Identity “<current_objectGUID>” –NewName “<new_objectGUID>”

To autopopulate the current and new ObjectID values from their respective columns and keep the inverted commas around the ObjectID values I needed to type the following:

=”Rename-ADObject –Identity “””&H3&””” -NewName “””&J3&””””

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s