From the Campaigns tab click Bulk Operations (in the left navigation panel).

Click Create and manage scripts.

Click Create script.

Replace "Untitled script" with your script's name.

Copy and paste the following code into the code editor. This script gets the 15 keywords that generated the least impressions over the last week. This script won't make any changes to your campaign data.

The difference between Preview and Run script now is that Preview gives you the chance to see how the script would affect your data without actually committing the changes. If the script modifies data, you should run it in preview mode first. For limitations of Preview mode, see Running scripts in Preview mode.

For multi-account scripts, you access the Scripts editor from Accounts Summary instead of Campaigns. To get an account that you manage, use the AccountsApp object. After getting the managed account, use the BingAdsApp object to access its entities.