This project is read-only.

NAME

Set-RegQWord

SYNOPSIS

Sets or creates a 64-bit binary number (REG_QWORD) on local or remote computers.

SYNTAX

Set-RegQWord [[-ComputerName] <>] [[-Hive] <>] [-Key] <> [-Value] <> [-Data] <> [-Force] [-View] [-Ping] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

 

PARAMETERS

-ComputerName <String[]>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? 1
Default value $env:COMPUTERNAME
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

 

-Hive <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? 2
Default value LocalMachine
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Key <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? true
Position? 3
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Value <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? true
Position? 4
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Data <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? true
Position? 5
Default value  
Accept pipeline input? false
Accept wildcard characters? false

 

-Force <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

 

-View <RegistryView>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value Default
Accept pipeline input? false
Accept wildcard characters? false

 

-Ping <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

 

-PassThru <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

 

-WhatIf <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? false

 

-Confirm <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? false

 

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS

 

OUTPUTS

PSFanatic.Registry.RegistryValue (PSCustomObject)

NOTES

Author: Shay Levy
Blog : http://PowerShay.com

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

C:\PS>$Key = "SOFTWARE\MyCompany"

Set-RegQWord -Key $Key -Value SystemLastStartTime -Data (Get-Date).Ticks

ComputerName Hive Key Value Data Type
------------ ---- --- ----- ---- ----
SERVER1 LocalMachine SOFTWARE\MyCompany SystemLastStartTime 633981970786684203 QWord


Description
-----------
The command sets the registry SystemLastStartTime QWord value on the local computer.
When the Switch parameter Ping is specified the command issues a ping test to each computer.
If the computer is not responding to the ping request a warning message is written to the console and the computer is not processed.

-------------------------- EXAMPLE 2 --------------------------

C:\PS>[Environment]::Is64BitProcess

False

PS> Set-RegQWord -Hive LocalMachine -Key SOFTWARE\Mykey -ComputerName Server1 -Value 64DWord -View Registry64 -Force -PassThru

ComputerName Hive Key Value Data Type
------------ ---- --- ----- ---- ----
Server1 LocalMachine SOFTWARE\Mykey 64DWord 250 QWord


Description
-----------
This command is using an elevated 32-bit instance of Windows PowerShell to set values on
a 64-bit registry section of a remote 64-bit server. First we verify that the current console
is a 32-bit instance by using the Is64BitProcess system environment variable.

Connecting to the 64-bit section of the remote server registry is done using the View
parameter.

-------------------------- EXAMPLE 3 --------------------------

C:\PS>Get-RegQWord -ComputerName "SERVER1","SERVER1","SERVER3" -Key $Key -Value SystemLastStartTime -Ping | Where-Object {$_.Data -eq 129057765227436584} | Set-RegQWord -Data (Get-Date).Ticks -Force -PassThru

ComputerName Hive Key Value Data Type
------------ ---- --- ----- ---- ----
SERVER1 LocalMachine SOFTWARE\MyCompany SystemLastStartTime 633981970786684203 QWord
SERVER2 LocalMachine SOFTWARE\MyCompany SystemLastStartTime 633981970786684203 QWord
SERVER3 LocalMachine SOFTWARE\MyCompany SystemLastStartTime 633981970786684203 QWord


Description
-----------
The command gets the registry SystemLastStartTime QWord value from three remote computers.
The result is piped to the Where-Object cmdlet and filters those who don not meet the Where-Object criteria.
The Results of Where-Object are piped to Set-RegQWord which sets the SystemLastStartTime value to the current date time ticks (Int64).

When the Switch parameter Ping is specified the command issues a ping test to each computer.
If the computer is not responding to the ping request a warning message is written to the console and the computer is not processed.
By default, the caller is prompted to confirm each action. To override confirmations, the Force Switch parameter is specified.
By default, the command doesn't return any objects back. To get the values objects, specify the PassThru Switch parameter.

RELATED LINKS

http://psrr.codeplex.com
Get-RegQWord Get-RegValue Remove-RegValue Test-RegValue

Last edited Jun 11, 2012 at 1:41 PM by Shay, version 2

Comments

No comments yet.