# Network Drive Manager

Interactive menu-based tool for managing GE Aerospace legacy domain network drives with credential testing, backup/restore, and server migration support.

## Overview

This tool helps users manage network drive mappings when transitioning between domain servers or when experiencing authentication issues. It provides a user-friendly interface for common drive management tasks.

## Features

- **View Mappings** - Display all current network drive mappings with legacy server detection
- **Backup/Restore** - Save and restore drive configurations as JSON
- **Credential Testing** - Verify passwords work before attempting connections
- **Full Reset** - Disconnect, clear credentials, and reconnect all drives
- **Server Migration** - Automatically update drives from old to new server names
- **Add Predefined Drives** - Quick setup for standard drive letters (S:, V:, Y:)
- **Error 1219 Prevention** - Three-phase connection approach for multiple shares

## Menu Options

| Option | Description |
|--------|-------------|
| 1. View Mappings | Show all network drives with [LEGACY] tags |
| 2. Backup | Save current mappings to Documents folder |
| 3. Test Credentials | Verify password against legacy servers |
| 4. Full Reset | Complete disconnect/reconnect cycle |
| 5. Restore | Reconnect drives from backup file |
| 6. Add Drives | Map predefined S:, V:, Y: drives |
| 7. Password Portal | Open mypassword.ge.com in browser |
| 8. Quit | Exit the application |

## Server Configuration

| Type | Server |
|------|--------|
| Old Server | `tsgwp00525.rd.ds.ge.com` |
| New Server | `tsgwp00525.wjs.geaerospace.net` |
| Y: Drive | `win.cighpeifep036.logon.ds.ge.com` |

## Predefined Drives

| Drive | Path | Description |
|-------|------|-------------|
| S: | `\\tsgwp00525.wjs.geaerospace.net\shared` | Standard shared drive |
| V: | `\\tsgwp00525.wjs.geaerospace.net\eng_apps` | Engineering applications |
| Y: | `\\win.cighpeifep036.logon.ds.ge.com\ugcam_res_lib` | UGCAM resource library |

## Files

```
NetworkDriveManager/
├── NetworkDriveManager.iss   # Inno Setup script (full implementation)
├── NetworkDriveManager.ps1   # Standalone PowerShell version
├── gea-logo.ico              # Setup icon
├── patrick.bmp               # Wizard banner
└── patrick-sm.bmp            # Wizard small image
```

## Usage

### Running the Tool

1. Compile `NetworkDriveManager.iss` with Inno Setup
2. Run the generated executable
3. Select options from the menu
4. Enter your legacy domain password when prompted

### Backup File Location

Backups are saved to:
```
%USERPROFILE%\Documents\NetworkDriveMappings.json
```

### Backup Format

```json
{
  "BackupDate": "2025-01-19 15:30:00",
  "ComputerName": "WORKSTATION01",
  "Username": "jsmith",
  "Mappings": [
    {
      "DriveLetter": "S:",
      "RemotePath": "\\\\tsgwp00525.wjs.geaerospace.net\\shared",
      "ServerName": "tsgwp00525.wjs.geaerospace.net",
      "ShareName": "shared",
      "IsLegacy": true
    }
  ]
}
```

## Error Handling

| Error Code | Meaning | Action |
|------------|---------|--------|
| 53 | Network path not found | Re-authenticate to Zscaler |
| 86 | Invalid password | Reset password at mypassword.ge.com |
| 1219 | Multiple connections exist | Tool handles automatically |
| 1326 | Bad username/password | Verify credentials |
| 1330 | Password expired | Reset password |
| 1909 | Account locked | Contact helpdesk |

## Three-Phase Connection Approach

To prevent Error 1219 when multiple drives point to the same server:

1. **Phase 1: Collect** - Gather all drives to be mapped
2. **Phase 2: Disconnect** - Remove ALL existing connections and clear IPC$
3. **Phase 3: Reconnect** - Map all drives with fresh credentials

This ensures Windows doesn't have conflicting credential sessions.

## Server Migration

When restoring drives, the tool automatically migrates server names:

```
\\tsgwp00525.rd.ds.ge.com\share → \\tsgwp00525.wjs.geaerospace.net\share
```

## Troubleshooting

### "Test credentials failed"
1. Verify you're connected to the corporate network (VPN/Zscaler)
2. Check if your password has expired
3. Try option 7 to reset your password

### "Error 1219: Multiple connections"
The tool handles this automatically. If it persists:
1. Run option 4 (Full Reset)
2. Log off and back on to Windows
3. Try again

### Drives don't appear after restore
1. Check Windows Explorer - drives may be disconnected
2. Run option 4 (Full Reset) to force reconnection
3. Verify network connectivity to the server

## Building

1. Install [Inno Setup 6.x](https://jrsoftware.org/isdl.php)
2. Open `NetworkDriveManager.iss`
3. Compile (F9)
4. Output: `Output/NetworkDriveManager.exe`

## Standalone PowerShell Script

For environments where Inno Setup isn't available, use:
```powershell
.\NetworkDriveManager.ps1
```

## Author

WJDT / GE Aerospace
