THWACK logo
THWACK
  • Sign In
  • Search
  • Community
    Community

    Find all you need to begin your THWACK journey, including documentation, missions, blogs, community groups, events, and media.

    Command Central
    • Getting Started
    MVP Program
    • MVP Program
    Monthly Mission
    • Puzzle Party
    Blogs
    • Community Announcements
    • Product Blog
    Groups
    • DevOps Discourse
    • Data Driven
    • See All Groups
    Events
    • SolarWinds User Group
    • THWACKcamp
      • ↪ 2024: On Demand
    • Bracket Battle
    Media Vault
    • Movies & Mainframes
    • TechPod
    • THWACK Tech Tips
    • THWACK Livecast
    • SolarWinds Lab Archive
    • THWACKcamp Archive
    • See All Media
  • Products
    Products

    Find the best place to learn and ask questions about your SolarWinds products.

    Observability
    • Observability Solutions
    • SolarWinds Observability SaaS
    • SolarWinds Observability Self-Hosted
    • SolarWinds Platform
    Network Management
    • Network Performance Monitoring
    • NetFlow Traffic Analyzer
    • Network Configuration Manager
    • IP Address Manager
    • User Device Tracker
    • VoIP & Network Quality Manager
    • Log Analyzer
    • Engineer's Toolset
    • Network Topology Mapper
    • Kiwi CatTools
    • Kiwi Syslog Server
    • ipMonitor
    Application Management
    • AppOptics
    • Loggly
    • Papertrail
    • Pingdom
    • DevOps
    IT Security
    • Access Rights Manager
    • Identity Monitor
    • Security Event Manager
    • Patch Manager
    • Serv-U FTP & MFT
    IT Service Management
    • SolarWinds Service Desk
    • Web Help Desk
    • DameWare Remote Support
    • DameWare Remote Everywhere
    • DameWare Mini Remote Control
    System Management
    • Server & Application Monitor
    • Virtualization Manager
    • Storage Resource Monitor
    • Server Configuration Monitor
    • SolarWinds Backup
    • Web Performance Monitor
    Database Management
    • Database Performance Analyzer
    • SQL Sentry
    • Database Performance Monitor
    • Database Mapper
    • Task Factory
  • Content Exchange
    Content Exchange

    Find downloadable files and templates other users have built and found useful to share with others.

    SolarWinds Platform
    • Alerts
    • Custom HTML
    • Custom Queries
    • Modern Dashboards
    • Reports
    • Scripts
    Server & Application Monitor
    • API Pollers
    • Application Monitor Templates
    Database Performance Analyzer
    • Custom Alerts
    • Custom Metrics
    • Custom Queries
    Server Configuration Monitor
    • Policies
    • Profiles
    Network Performance Monitor
    • Device Pollers
    • Universal Device Pollers
    Network Configuration Manager
    • Config Change Scripts
    • Device Templates
    • Firmware Upgrade Templates
    • Policy Documents
    SQL Sentry
    • Advisory Conditions
    Web Help Desk
    • Style Sheets
  • Resources
    SolarWinds Customer Portal Customer Portal

    Create individual user accounts for your team, manage your licenses, download your SolarWinds software, create and track support tickets, and more.

    SolarWinds Academy Academy

    A one-stop-shop for world-class training for SolarWinds products through on-demand videos, and instructor-led classes. All SolarWinds Academy content is included with every software purchase.

    SolarWinds Customer Success Support

    Get help when you need it from a world-class support team, available to assist with technical product issues 24 hours a day, seven days a week, 365 days a year.

    SolarWinds Partner Portal Partner Portal

    Accelerate SolarWinds Partners’ ability to drive digital and IT transformation for customers with powerful tools, resources, and increased profit potential.

  • Free Tools & Trials
  • Store
The SolarWinds Platform
  • Content Exchange
The SolarWinds Platform
Scripts Remove Domain and Capitalize Node Captions
  • Tags
  • More
  • Cancel
Options
  • View all
  • Previous
  • Next
  • View slideshow
  • More
  • Cancel
fileName
Sign in to Download

Remove Domain and Capitalize Node Captions

This is a simple learning script which shows several steps in logically thinking about scripting and how to interface with the Orion API.

Description

When executed, this script will get all nodes registered via WMI, SNMP, or Agent.  For each of them it will strip off the domain name and capitalize everything that's left and then update the Orion node to use that caption name.

Custom Properties Required

  • None

Script Details

  • Lines 8 - 10: Builds your connection to the SolarWinds Information Service
  • Lines 13 - 22: The query we are using to find node captions matching our simple domain name check.
  • Line 25: Retrieves the list of nodes matching our query.
  • Lines 28 - 34: Loops through each node to update, strips off everything after the first period (.), capitalizes it, sends a message back to the console. and sends the update request to the API.

Featured on THWACK Livecast: Orion Automation Made Easy / Session Two – Using the Orion API for Fun and Profit

  • Orion 2020.2.6
  • Node Captions
  • PowerShell
KMSigma.SWI
KMSigma.SWI
  • 3 Dec 2021
  • 198 Downloads
  • Share
  • More
  • Cancel
  • Sign in to reply
  • rodeyd
    rodeyd over 1 year ago

    Hi,

    I'm new at scripting for Solarwinds. I followed your script and modified for my use. The script (below) works for a single node but doesn't for a bulk change. I don't know what I'm doing wrong.

    Any help would be appreciated.

    $credential = Get-Credential
    $swis = Connect-Swis -Hostname localhost -Cred $credential

    $query = "
    Select
    caption, URI

    From Orion.Nodes

    Where Caption Like 'T5040PD-xxx.xx.%'
    "
    $result = Get-SwisData -SwisConnection $swis -Query $query

    foreach ($node in $result) {

    $newname = $node.Caption -replace "xxx.xx.",""

    Write-Output " Renaming nodes $($node.Caption) to $newname " }

    Set-SwisObject -SwisConnection $swis -Uri $node.URI -Properties @{ Caption = $newname }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel

SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 200,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.

SolarWinds Customer Success Center Certification SolarWinds Lab Link Customer Portal
About THWACK SolarWinds Blog Federal & Government Edit Settings Free Tools & Trials
Legal Documents Terms of Use Privacy California Privacy Rights Security Information
©2021 SolarWinds Worldwide, LLC. All Rights Reserved.