Jump to content

mattsibley

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by mattsibley

  1. Hi everyone, Sorry work got on top of me for a bit. I know how I am going to go for this. For now, the XenServer is only going to be used to build out a Windows Active Directory Domain to sharpen my 2k12 r2 sills ahead of the exams, then later use that built up domain as a target for m Kali VM. In its current configuration, i won't be doing malware analysis on the system. Thank you, everyone, for your suggestions and help. Matt
  2. Hi, I need some help with setting up my home lab. Want I want to do is to have my PC be able to manage Citrix XenServer, with the VMs on a closed host only network. But I am not too sure how to go about it? Would I need to connect the VM's to a pfsense router VM or can I network the VMs directly in XenServer? Also, would I need to hardwire my XenServer to my PC via a switch to enable management of it on the closed network when my pc communicates directly with the router via wifi? Sorry if this is a bit noobtacular I don't really want to screw this up. Matt
  3. @PoSHMagiC0de Thanks, mate! I was struggling for a bit there. I will make sure to mention you in the code's comments when it is done.
  4. I am finding that I am having an error with some PowerShell code that I am working on. What I want to be able to do is to have a variable, say $uk, where the drive label name is 'backup' and then force the creation of folders using the declared variable as the drive letter eg $uk\$env:computername\$env:username . The code is pasted below: #Asssigns $uk Variable to current drive letter for the mounted volume where the label name = backup $uk = Get-WmiObject Win32_Volume | ? {$_.label -eq 'backup'} #Creates a directory on the C:\ Drive naming the folders [The Computer Name] and [User] and ignores if already exists. md $uk\$env:computername\$env:username -force | Out-Null #It then uses Get-WmiObject to get the OS information and exports this info to the created directory calling the file export.csv. Get-WmiObject -class win32_operatingsystem | Export-Csv $uk\$env:computername\$env:username\export.csv #Then echos Export Complete into console. echo "Export Complete" #Sleep for two seconds. Start-Sleep -s 2 #Kill Powershell process. #stop-process -Id $Pid However, when this runs I get this error: md : Illegal characters in path. At C:\Users\Matt\OneDrive\Documents\Matt's Documents\ExportOSInfo.ps1:8 char:1 + md $uk\$env:computername\$env:username -force | Out-Null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (\\MATT-PC\root\...6ed}\\"\MATT-PC:String) [New-Item], Argu mentException + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.NewItemCommand md : Illegal characters in path. At C:\Users\Matt\OneDrive\Documents\Matt's Documents\ExportOSInfo.ps1:8 char:1 + md $uk\$env:computername\$env:username -force | Out-Null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (\\MATT-PC\root\...6ed}\\"\MATT-PC:String) [New-Item], Argu mentException + FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShell.Commands.NewItemCommand md : Illegal characters in path. At C:\Users\Matt\OneDrive\Documents\Matt's Documents\ExportOSInfo.ps1:8 char:1 + md $uk\$env:computername\$env:username -force | Out-Null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (\\MATT-PC\root\...\"\MATT-PC\Matt:String) [New-Item], Argu mentException + FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShell.Commands.NewItemCommand Export-Csv : Cannot perform operation because the wildcard path \\MATT-PC\root\cimv2:Win32_Volume.DeviceID= "\\\\?\\Volume{2277fba4-e118-11e3-8533-94de807ff6ed}\\"\MATT-PC\Matt\export.csv did not resolve to a file. At C:\Users\Matt\OneDrive\Documents\Matt's Documents\ExportOSInfo.ps1:10 char:46 + ... ingsystem | Export-Csv $uk\$env:computername\$env:username\export.csv ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (\\MATT-PC\root\...Matt\export.csv:String) [Export-Csv], FileNotF oundException + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.ExportCsvCommand Obviously there is an error in the file path where it is trying to get the volume. I am not too sure how i would fix this tried wrapping the variable name in ${} and with a :\ after the variable eg $uk:\, neither of these produce the desired result. Can anyone help? Matt
×
×
  • Create New...