This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string]$UserName | |
| ) | |
| $uidNumber = [int](Get-ADUser -LDAPFilter "(uidNumber=*)" -Properties uidNumber | Sort-Object -Descending -Property uidNumber)[0].uidNumber + 1 | |
| $user = Get-ADUser $UserName -Properties uidNumber | |
| if(($user) -and (-not $user.uidNumber)) { | |
| "Unix enabling user: $($user.Name) with uidNumber: $uidNUmber" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var computer = "." | |
| var wmi = GetObject("winmgmts://" + computer + "/root/CIMv2") | |
| var lv = wmi.ExecQuery("SELECT * FROM Win32_LogicalDiskToPartition") | |
| i=0 | |
| for (var e = new Enumerator(lv); !e.atEnd(); e.moveNext()) | |
| { | |
| var z = e.item() | |
| driveLetter = z.Dependent.split("=")[z.Dependent.split("=").length - 1].replace(/\"/g,"") | |
| WScript.Echo("DriveLetter: " + driveLetter) | |
| partition = z.Antecedent.split("=")[z.Antecedent.split("=").length - 1].replace(/\"/g,"") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr_groups = new Array() | |
| System.log("Name Starts With: " + nameStartsWith) | |
| System.log("Running active Directory Search") | |
| var groups = ActiveDirectory.search("UserGroup", nameStartsWith) | |
| for (var i in groups) { | |
| System.log("building group array : " + groups[i].name) | |
| arr_groups.push(groups[i].name) | |
| } | |
| return arr_groups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr_groups = new Array() | |
| System.log(nameStartsWith) | |
| System.log("Running active Directory Search") | |
| var groups = ActiveDirectory.search("UserGroup", nameStartsWith) | |
| var arr_ExceptionList = exceptionList.split(",") | |
| for (var i in groups) { | |
| if(arr_ExceptionList.indexOf(groups[i].name) == -1) { | |
| arr_groups.push(groups[i].name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Copyright: (c) 2018, Keiran Steele | |
| # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
| import os | |
| import sys | |
| import argparse | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.2/4.2.0/rhcos-4.2.0-x86_64-vmware.ova -o rhcos-4.2.0-x86_64-vmware.ova | |
| govc import.ova -name=rhcos-4.2.0-x86_64-vmware ./rhcos-4.2.0-x86_64-vmware.ova | |
| export GOVC_URL='vsphere.server.local | |
| export GOVC_USERNAME='admin@vsphere.local' | |
| export GOVC_PASSWORD='password | |
| export GOVC_INSECURE=1 | |
| export GOVC_NETWORK='NETWORK' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try{ | |
| $luns = get-vmhost | Get-Datastore | Get-ScsiLun -ErrorAction SilentlyContinue | |
| # $luns.CanonicalName | |
| } catch { | |
| "Error getting lun info for one or more luns" | |
| } | |
| $array = @() | |
| Get-VMHost | Get-ScsiLun | ?{$_.CanonicalName -notlike "mpx.*"} | %{ | |
| if(($luns.CanonicalName -notcontains $_.CanonicalName) -and ($array -notcontains $_.CanonicalName)) { | |
| $array += $_.CanonicalName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $basepath = 'C:\Storage-Migration' | |
| $content = gc "$basepath\mc\mcsvc01vdisks.txt" | |
| gc "$basepath\mc\mcsvc01vdisksbyhost.txt" | %{ | |
| $line = $_ | |
| if($line -match "^\d+") { | |
| $match = [regex]::Matches($line, "\S*(?>\s+)") | |
| $vol_match = $content | sls -Pattern $(($match[4].value).Trim()) | |
| try{ | |
| if($match) { | |
| $vol_size = [regex]::Match($vol_match,'(?<=,)[\w\.\w]+(?=,[m\d])') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var reg = new RegExp("^"+ strVmName + "$", 'ig'); | |
| for each(vm in VcPlugin.getAllVirtualMachines(null,"xpath:name='" + strVmName + "'")) { | |
| if(vm.name.match(reg)) { | |
| vcenterSdk = vm.sdkConnection | |
| vmOut = vm | |
| System.log(vmOut.summary) | |
| System.log(vcenterSdk) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: psp:vmware-system-privileged | |
| roleRef: | |
| kind: ClusterRole | |
| name: psp:vmware-system-privileged | |
| apiGroup: rbac.authorization.k8s.io | |
| subjects: | |
| - kind: ServiceAccount |
OlderNewer