Advertisement
Guest User

Untitled

a guest
May 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. $time = (Get-Date -UFormat "%m/%d/%y")
  2. $opendbbakpath =
  3. $userlistpath =
  4. function update-taskusers {
  5. get-aduser -filter {(enabled -eq $true -and passwordneverexpires -eq $false)} | select -ExpandProperty name | Export-Clixml -Path $userlistpath
  6. }
  7. Function Create-XML
  8. {
  9. $tasks = @()
  10. $tasks += new-object psobject -property @{index=1;createdate=($time);description="nulltask";user=$user}
  11. $tasks += new-object psobject -property @{index=2;createdate=($time);description="nulltask";user=$user}
  12. $tasks += new-object psobject -property @{index=3;createdate=($time);description="nulltask";user=$user}
  13. $tasks | Export-Clixml -Path "$opendbpath"
  14. }
  15. Function New-Task
  16. {
  17. $tasks = @()
  18. $tasks = Import-Clixml -Path "$opendbpath"
  19. [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
  20. $description = [Microsoft.VisualBasic.Interaction]::InputBox('description?')
  21. $userlist = Import-Clixml -Path $userlistpath
  22. $user = $userlist | Out-GridView -PassThru
  23. $index = ($tasks | select -ExpandProperty index -Last 1)+1
  24. $tasks += new-object psobject -property @{index=$index;createdate=($time);description=$description;user=$user}
  25. $tasks | Export-Clixml -Path "$opendbpath"
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement