When I try to use Get-AutoscaleHistory, I always get no results.
I've taken a look at https://msdn.microsoft.com/en-us/library/mt282464.aspx but don't really have any hints. I've imitated the example specified to no avail.
Get-AutoscaleHistory -Star 2015-11-11T18:35:00 -end 2015-11-15T18:40:00 -det
I've verified that I am using a subscription that has autoscale settings configured, and that those settings have actually caused scaling to happen, both up and down.
Has anybody used this cmdlet successfully?
Related
My pipeline gives OOM errors constantly so I read a fowllowing answer and try to set --dumpHeapOnOOM and --saveHeapDumpsToGcsPath. But it seems that these options do not work. Do I need to change my code or modify something else?
Memory profiling on Google Cloud Dataflow
You will want to check configuring-pipeline-options.
The current way in Apache Beam (2.9.0) to configure pipeline option in command line is --<option>=<value>.
In your case, you can set --dumpHeapOnOOM=true --saveHeapDumpsToGcsPath="gs://foo"
I want to create CloudWatch alarms automatically on instance launch (via AutoScaling, CLI or whatever).
My instances are running Windows, so I created task in Task Scheduler which executes PowerShell script.
This script uses Write-CWMetricAlarm cmdlet to create CloudWatch Alarms - http://prntscr.com/e6xptj
It works good for custom Metrics like Windows/Default , but for AWS/EC2 InstanceName is required as well - http://prntscr.com/e6xq18
But there's no Dimension for InstanceName - http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html
.. as well as no suitable parameter for Write-CWMetricAlarm Cmdlet - http://docs.aws.amazon.com/powershell/latest/reference/Index.html
So any ideas about how this issue can be solved?
Thanks in advance!
Instance names are actually just tags (with key "Name") and the console gives them special treatment to make them appear as a first-class item. They also do not need to be unique, so using 'name' wouldn't enable CloudWatch to distinguish between different instances, making things confusing from an alarm perspective.
I think therefore that you need to be using the instance id value. In your script I notice you're using Invoke-Restmethod to obtain it - you might be interested to know you can also get this value using a cmdlet:
Get-EC2InstanceMetadata -Category InstanceId
I have spent a couple of hours search for a solution to disable my Azure Service Bus Topics using Powershell.
The background for this is we want to force a manual failover to our other region.
Obviously I could click in the Portal:
but I want to have a script to do this.
Here is my current attempt:
Any help would be great.
Assuming you're sure your $topic contains the full description, modify the status parameter in the array and then splat it back using the UpdateTopic method. I'm afraid I can't test this at present.
$topic.Status = "Disabled"
$topicdesc = $NamespaceManager.UpdateTopic($topic)
I don't think you'll need to set the entity type for the Status, nor do you require semi-colons after each line of code in your loop.
References
PowerShell Service Bus creation sample script (which this appears to be based off): https://blogs.msdn.microsoft.com/paolos/2014/12/02/how-to-create-service-bus-queues-topics-and-subscriptions-using-a-powershell-script/
UpdateTopic method: https://msdn.microsoft.com/en-us/library/azure/microsoft.servicebus.namespacemanager.updatetopic.aspx
Additional note: please don't screenshot the code - paste it in. I'd rather copy-and-paste than type things out.
Just as we have in Intersystem Cache D ^JOBEXAM to examine the jobs running in background or scheduled.
How can we do the same in GTM?
Do we have any command for the same. Please advice.
The answer is $zinterrupt; and what triggers it: mupip intrpt. Normally it dumps a file on your GT.M start-up directory containing the process state via ZSHOW "*"; however, you can make $zinterrupt do any thing you want.
$ZINT documentation:
http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch08s35.html
A complex example of using $ZINT:
https://github.com/shabiel/random-vista-utilities/blob/master/ZSY.m
--Sam
Late answer here. In addition to what Sam has said, there is a code set, "^ZJOB" that is used in the VistA world. I could get you copies of this if you wanted.
When I run get-user|get-member in powershell with the exchange add-in I noticed there is no description property.
Does anyone know if it has been renamed to something else or another way of accessing it?
If you aren't looking to change the description this should work:
[PS] C:\>$ANR = "testuser#example.com"
[PS] C:\>$foo = [adsi]("LDAP://" + (get-user $ANR).DistinguishedName)
[PS] C:\>$foo.description
My Description
If you are wanting to edit, you will need to get further into System.DirectoryServices & look at how to write objects back to AD. It would likely be simpler to use quest of another package that does some wrapping. If you want to roll your own there are gobs of blogs on AD programming in Powershell.
Exchange itself provides minimal interaction with AD - essentially, it gives you some AD stuff because AD and Exchange are so connected, but it doesn't try to expose all of AD's functionality.
Check out quest.com/powershell; that is an add-in library (it's free), and it has a cmdlet called Get-QADUser which will get you what you need - somewhat more easily, and in a more PowerShell-ish fashion, than using ADSI (which is also completely legit for what you're after).
get-user? do you mean get-qaduser from the quest cmdlet suite?
if so, I believe not all properties are retrieved by default. There's an -Include parameter that lets you specify additional properties to retrieve from AD, IIRC.
It works on the console; however in the CSV file, it keeps appending
System.DirectoryServices.PropertyValueCollection
to the end of each line instead of the value
When I run it on the prompt by typing out the distinguishedname, the ldap query works..
$tmp =adsi
$tmp.description
bill
any ideas?
solved it.. its just $tmp.description.value