Jump to content


Scripteur

Established Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Scripteur's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Exact I see the error when I try to apply the output to OSDDiskIndex variable in the task sequence using Run Command Line : (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDDiskIndex') = $MonDisk.Disk }" thanks
  2. I can confirm you that this script is working when execute in localy in my machine, you can test it in your machine to be sure. thanks Get-WmiObject Win32_DiskDrive | % { $disk = $_ $partitions = "ASSOCIATORS OF " + "{Win32_DiskDrive.DeviceID='$($disk.DeviceID)'} " + "WHERE AssocClass = Win32_DiskDriveToDiskPartition" Get-WmiObject -Query $partitions | % { $partition = $_ $drives = "ASSOCIATORS OF " + "{Win32_DiskPartition.DeviceID='$($partition.DeviceID)'} " + "WHERE AssocClass = Win32_LogicalDiskToPartition" Get-WmiObject -Query $drives |Where-Object {$_.DeviceID -eq "C:"} | % { $MonDisk = New-Object -Type PSCustomObject @{ Disk = $disk.index } $MonDisk.Disk } } }
  3. yes when I excute it on Task sequence, it givens error! But how can use a custom variable in task sequence? thanks
  4. Thanks for your reply! no problem with the script, it is given me the right Output, my problem is how to set this output ( OSDDiskIndex variable) in my Task Sequence. Thanks
  5. Thanks for your quick reply. In our company, there is some developpers that need two disk on their computers. here is the command line that I execute before Format and partition step. powershell –executionpolicy bypass "@{ Get-WmiObject Win32_DiskDrive | % { $disk = $_ $partitions = "ASSOCIATORS OF " + "{Win32_DiskDrive.DeviceID='$($disk.DeviceID)'} " + "WHERE AssocClass = Win32_DiskDriveToDiskPartition" Get-WmiObject -Query $partitions | % { $partition = $_ $drives = "ASSOCIATORS OF " + "{Win32_DiskPartition.DeviceID='$($partition.DeviceID)'} " + "WHERE AssocClass = Win32_LogicalDiskToPartition" Get-WmiObject -Query $drives |Where-Object {$_.DeviceID -eq "C:"} | % { $MonDisk = New-Object -Type PSCustomObject @{ Disk = $disk.index } $MonDisk.Disk } } } (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDDiskIndex') = $MonDisk.Disk }" and error is : Le moteur d'exécution des séquences de tâches a terminé l'action (Set Disk number) dans le groupe (Installer le système d'exploitation) avec code de sortie 0 Sortie de l'action : ... = $disk.index } $MonDisk.Disk } } } (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDDiskIndex') = $MonDisk.Disk }" returned 0 Au caractŠre Ligne:1 : 7 + @{ Get-WmiObject Win32_DiskDrive | % { $disk = $_ $partitions = ASSOCIATORS ... + ~ Op‚rateur ®ÿ=ÿ¯ manquant aprŠs la cl‚ dans le litt‚ral de hachage. Au caractŠre Ligne:1 : 7 + @{ Get-WmiObject Win32_DiskDrive | % { $disk = $_ $partitions = ASSOCIATORS ... + ~ Le litt‚ral de hest incomplet. Au caractŠre Ligne:1 : 648 + ... k } } } (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDDis ... + ~ Jeton inattendu ®ÿ(ÿ¯ dans l'expression ou l'instruction. Au caractŠre Ligne:1 : 738 + ...$MonDisk.Disk } + ~ Jeton inattendu ®ÿ}ÿ¯ dans l'expression ou l'instruction. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx ception + FullyQualifiedErrorId : MissingEqualsInHashLiteral. thank you for your help!
  6. Hello, I need your precious help. I tried to deploy W10 OS using captured image and task sequence on computer that has 2 disks. there is W7 OS already installed on disk 1, I have created a package included a powershell script that detect automatically the disk index where the W7 OS already installed and change value of OSDDiskindex variable accordingly so in next step Format and partition TS take this variable into consideration, but no success!! My aim is to deploy W10 OS on this same disk but I am not able to use OSDDiskindex effeciently in my TS. Could you a please help me? Your help will be so much apprecied!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.