在 Adaxes PowerShell 操作中写入参数值
这是一个关于Softerra Adaxes Active Directory Management软件中使用的PowerShell与自定义命令(或计划的任务)一起使用的问题。
我试图在使用自定义命令时接受用户的参数,然后我需要采用该值并将其修改以在自定义命令的将来操作中使用。
一个“例如”用例是创建一个将用户脱离办公室的脚本,自定义命令在外部消息中获取目标用户参考。自定义命令中的第一个操作将找到提供的用户的电子邮件地址,然后第二个操作将设置外部,并通过消息告诉收件人立即提供帮助,以通过电子邮件发送提供的用户的电子邮件地址。我意识到可能有一些方法可以用一个PowerShell脚本解决此问题,但是在许多情况下,使用脚本操作处理提供的信息将是有益的,以便在自定义命令中使用多个将来的操作。
我已经知道如何在softerra adaxes中访问自定义命令中的参数值,但是我不知道如何写入参数值。
访问值:
$context.GetParameterValue('param-Example')
有人知道如何写入参数值吗? $ context.setparametervalue()
不起作用。这对于能够在ADAXES中的自定义命令中存储和操纵值的值将非常有用。
This is a question about using PowerShell with Custom Commands (or scheduled tasks) in the Adaxes Active Directory management software by Softerra.
I am trying to accept a parameter from a user when using a custom command, then I need to take that value and modify it for use in a future action of the custom command.
A "for example" use-case would be creating a script that sets a user's out of office, where the custom command takes a target user reference in the out of office message. The first action in the custom command would find the email address of the provided user, then the second action would set the out-of-office with a message telling recipients for immediate assistance to email the provided user's email address. I realize there may be ways to solve this with one PowerShell script, but there are MANY scenarios where it would be beneficial to process provided information with a script action for use with MULTIPLE future actions in the custom command.
I already know how to access parameter values in custom commands for Softerra Adaxes, but I can't figure out how to WRITE to parameter values.
Accessing values:
$context.GetParameterValue('param-Example')
Does anyone know how to write TO parameter values? $context.SetParameterValue()
does not work. This would be extremely useful for being able to store and manipulate values between actions in custom commands in Adaxes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人正在寻找类似的东西,我从 Adaxes 支持部门得到的答案是,目前无法使用他们的软件来做到这一点。
唯一的解决方法是写入正在修改的对象的属性,然后稍后引用该属性。
例如,将值写入用户的 extensionAttribute1 属性,然后在脚本中的不同操作中引用该值。
如果有人提出更好的解决方案或者 Adaxes 改变了这一点,请随时提出更好的解决方案!
If anyone is looking for something similar, the answer I got from Adaxes support was that there is no means to do this currently with their software.
The only work-around would be writing to a property of the object being modified, then reference that property later.
For instance, writing a value to the extensionAttribute1 property of a user, then referencing that later in the script in a different action.
If anyone comes up with a better solution or Adaxes changes this, please feel free to suggest a better solution!